From 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 30 Jul 2018 15:56:09 -0400 Subject: Containerization feature of SO Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18 Issue-ID: SO-670 Signed-off-by: Benjamin, Max (mb388a) --- .../adapters/catalogdb/CatalogDBApplication.java | 47 ++ .../CatalogDbRepositoryConfiguration.java | 43 ++ .../so/adapters/catalogdb/JerseyConfiguration.java | 55 ++ .../adapters/catalogdb/WebSecurityConfigImpl.java | 51 ++ .../catalogdb/catalogrest/CatalogQuery.java | 99 +++ .../catalogrest/CatalogQueryException.java | 58 ++ .../catalogrest/CatalogQueryExceptionCategory.java | 23 + .../catalogrest/CatalogQueryExceptionCommon.java | 75 ++ .../QueryAllottedResourceCustomization.java | 123 ++++ .../catalogdb/catalogrest/QueryResourceRecipe.java | 75 ++ .../catalogdb/catalogrest/QueryServiceCsar.java | 72 ++ .../catalogrest/QueryServiceMacroHolder.java | 97 +++ .../catalogrest/QueryServiceNetworks.java | 117 +++ .../catalogdb/catalogrest/QueryServiceVnfs.java | 122 ++++ .../catalogdb/catalogrest/QueryVfModule.java | 121 ++++ .../catalogdb/rest/CatalogDbAdapterRest.java | 600 ++++++++++++++++ .../so/adapters/catalogdb/rest/package-info.java | 28 + .../adapters/catalogdb/CatalogDbAdapterRest.java | 573 --------------- .../catalogdb/catalogrest/CatalogQuery.java | 92 --- .../catalogrest/CatalogQueryException.java | 54 -- .../catalogrest/CatalogQueryExceptionCategory.java | 22 - .../catalogrest/CatalogQueryExceptionCommon.java | 67 -- .../QueryAllottedResourceCustomization.java | 119 ---- .../catalogdb/catalogrest/QueryResourceRecipe.java | 75 -- .../catalogdb/catalogrest/QueryServiceCsar.java | 72 -- .../catalogrest/QueryServiceMacroHolder.java | 95 --- .../catalogrest/QueryServiceNetworks.java | 113 --- .../catalogdb/catalogrest/QueryServiceVnfs.java | 121 ---- .../catalogdb/catalogrest/QueryVfModule.java | 119 ---- .../src/main/resources/application-local.yaml | 51 ++ .../src/main/resources/application.yaml | 55 ++ .../migration/V1810.1__AddModelAndModelRecipe.sql | 31 + .../resources/db/migration/V1__Base_version.sql | 343 +++++++++ .../V2.0.0__Modify_Resource_Relationships.sql | 247 +++++++ ...2.0.1__Modify_Resource_Relationships_Alters.sql | 208 ++++++ .../migration/V2.10__VNFCInstanceGroupChanges.sql | 7 + .../db/migration/V2.11__Modify_IS_Base_Type.sql | 4 + .../V2.12__UpdateMacroReferenceData_Homing.sql | 4 + ..._external_service_to_internal_model_mapping.sql | 4 + .../migration/V2.14__DeactivateAndCloudDelete.sql | 10 + ...Valid_Action_State_Transition_Table_Updates.sql | 93 +++ ...K_To_Building_Block_Detail_Pre_New_Solution.sql | 4 + .../V2.17__DeactivateAndCloudDeleteChanges.sql | 8 + .../V2.18__AlterVNFRecipeVnfTypeColumnName.sql | 9 + .../migration/V2.1__Update_Recipe_For_API_Flag.sql | 34 + .../db/migration/V2.2__ONAP_TABLE_CHANGES.sql | 30 + .../db/migration/V2.3__MacroTableChanges.sql | 24 + .../db/migration/V2.4__MacroReferenceData1806.sql | 130 ++++ .../migration/V2.5__RainyDayHandlerMacroData.sql | 45 ++ .../migration/V2.6__NorthboundAddTopLevelFlow.sql | 28 + .../db/migration/V2.7__VNFCInstanceGroup1806.sql | 57 ++ ...hestrationStatus_ValidActionStateTransition.sql | 398 +++++++++++ .../migration/V2.9__UpdateIsTopLevelFlowColumn.sql | 4 + ...3.1__AddServiceMacroDeactivateToMacroTables.sql | 7 + .../V3.2__ChangeMINApiVersionInNorthbound.sql | 5 + ...__ChangeMINApiVersionServiceMacroDeactivate.sql | 3 + .../migration/V3.4__AddUpdateNetworkALaCarte.sql | 20 + ...GrApiDefault_To_UpdateVfModuleVolumeInfraV1.sql | 4 + .../V3.6__UpdateNetworkCollectionCatalogDB.sql | 38 + .../V3.7__FixDeactivateNetworkCollection.sql | 5 + .../V3.8__UnassignFabricConfigurationData.sql | 31 + .../db/migration/V3.9__DropCRModelUUID_FK.sql | 3 + .../src/main/resources/static/index.html | 41 ++ .../src/main/resources/static/readme/index.html | 53 ++ .../src/main/resources/static/readme/install.html | 34 + .../src/main/resources/static/readme/jars.html | 34 + .../src/main/resources/static/readme/layout.html | 34 + .../src/main/resources/static/readme/logging.html | 34 + .../src/main/resources/static/readme/onaplogo.png | Bin 0 -> 21360 bytes .../main/resources/static/readme/packaging.html | 34 + .../src/main/resources/static/readme/page.html | 67 ++ .../src/main/resources/static/readme/readme.css | 114 +++ .../src/main/resources/static/readme/spring.html | 34 + .../src/main/resources/static/readme/tools.html | 34 + .../resources/static/swagger/favicon-16x16.png | Bin 0 -> 445 bytes .../resources/static/swagger/favicon-32x32.png | Bin 0 -> 1141 bytes .../src/main/resources/static/swagger/index.html | 95 +++ .../resources/static/swagger/oauth2-redirect.html | 60 ++ .../resources/static/swagger/swagger-ui-bundle.js | 99 +++ .../static/swagger/swagger-ui-standalone-preset.js | 13 + .../main/resources/static/swagger/swagger-ui.css | 2 + .../resources/static/swagger/swagger-ui.css.map | 1 + .../main/resources/static/swagger/swagger-ui.js | 8 + .../adapters/catalogdb/EmbeddedMariaDbConfig.java | 60 ++ .../catalogdb/catalogrest/CatalogDBRestTest.java | 782 +++++++++++++++++++++ .../catalogrest/CatalogQueryExceptionTest.java | 55 ++ .../NetworkCollectionCatalogDbQueryTest.java | 153 ++++ .../catalogrest/QueryResourceRecipeTest.java | 70 ++ .../catalogrest/QueryServiceCsarTest.java | 69 ++ .../catalogdb/catalogrest/QueryVfModuleTest.java | 100 +++ .../catalogdb/catalogrest/TestAppender.java | 37 + .../catalogdb/CatalogDbAdapterRestClassTest.java | 380 ---------- .../catalogdb/CatalogDbAdapterRestHttpTest.java | 490 ------------- .../catalogdb/CatalogDbAdapterRestTest.java | 103 --- .../catalogrest/CatalogQueryExceptionTest.java | 55 -- .../catalogdb/catalogrest/CatalogQueryTest.java | 155 ---- .../QueryAllottedResourceCustomizationTest.java | 67 -- .../catalogrest/QueryResourceRecipeTest.java | 74 -- .../catalogrest/QueryServiceCsarTest.java | 75 -- .../catalogrest/QueryServiceMarcoHolderTest.java | 74 -- .../catalogrest/QueryServiceNetworksTest.java | 72 -- .../catalogrest/QueryServiceVnfsTest.java | 73 -- .../catalogdb/catalogrest/QueryVfModuleTest.java | 96 --- .../src/test/resources/application-test.yaml | 70 ++ .../test/resources/db/migration/afterMigrate.sql | 198 ++++++ .../src/test/resources/logback-test.xml | 50 ++ .../response/expectedServiceResponse.json | 78 ++ .../response/expectedServiceResponseV2.json | 78 ++ .../test/resources/response/serviceResponse.json | 78 ++ 109 files changed, 6419 insertions(+), 3236 deletions(-) create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryException.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipe.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceCsar.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVfModule.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/package-info.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsar.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java delete mode 100644 adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/application.yaml create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1810.1__AddModelAndModelRecipe.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1__Base_version.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.0__Modify_Resource_Relationships.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.1__Modify_Resource_Relationships_Alters.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.10__VNFCInstanceGroupChanges.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.11__Modify_IS_Base_Type.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.12__UpdateMacroReferenceData_Homing.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.13__Alter_external_service_to_internal_model_mapping.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.14__DeactivateAndCloudDelete.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.16__Remove_Orchestration_Flow_Reference_FK_To_Building_Block_Detail_Pre_New_Solution.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.17__DeactivateAndCloudDeleteChanges.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.18__AlterVNFRecipeVnfTypeColumnName.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.1__Update_Recipe_For_API_Flag.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.2__ONAP_TABLE_CHANGES.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.3__MacroTableChanges.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.4__MacroReferenceData1806.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.5__RainyDayHandlerMacroData.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.6__NorthboundAddTopLevelFlow.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.8__OrchestrationStatus_ValidActionStateTransition.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.9__UpdateIsTopLevelFlowColumn.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.1__AddServiceMacroDeactivateToMacroTables.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.2__ChangeMINApiVersionInNorthbound.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.3__ChangeMINApiVersionServiceMacroDeactivate.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.4__AddUpdateNetworkALaCarte.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.5__PointGrApiDefault_To_UpdateVfModuleVolumeInfraV1.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.6__UpdateNetworkCollectionCatalogDB.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.7__FixDeactivateNetworkCollection.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.8__UnassignFabricConfigurationData.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.9__DropCRModelUUID_FK.sql create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/index.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/index.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/install.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/jars.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/layout.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/logging.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/onaplogo.png create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/packaging.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/page.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/readme.css create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/spring.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/readme/tools.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-16x16.png create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-32x32.png create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/index.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/oauth2-redirect.html create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui-bundle.js create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui-standalone-preset.js create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui.css create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui.css.map create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui.js create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/EmbeddedMariaDbConfig.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceCsarTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVfModuleTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/TestAppender.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestClassTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestHttpTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomizationTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsarTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMarcoHolderTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworksTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfsTest.java delete mode 100644 adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModuleTest.java create mode 100644 adapters/mso-catalog-db-adapter/src/test/resources/application-test.yaml create mode 100644 adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql create mode 100644 adapters/mso-catalog-db-adapter/src/test/resources/logback-test.xml create mode 100644 adapters/mso-catalog-db-adapter/src/test/resources/response/expectedServiceResponse.json create mode 100644 adapters/mso-catalog-db-adapter/src/test/resources/response/expectedServiceResponseV2.json create mode 100644 adapters/mso-catalog-db-adapter/src/test/resources/response/serviceResponse.json (limited to 'adapters/mso-catalog-db-adapter/src') diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java new file mode 100644 index 0000000000..ce98b74fab --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@SpringBootApplication(scanBasePackages = {"org.onap.so.adapters.catalogdb", "org.onap.so.db.catalog.client"}) +@EnableJpaRepositories("org.onap.so.db.catalog.data.repository") +@EntityScan("org.onap.so.db.catalog.beans") +public class CatalogDBApplication { + + private static final String LOGS_DIR = "logs_dir"; + + private static void setLogsDir() { + if (System.getProperty(LOGS_DIR) == null) { + System.getProperties().setProperty(LOGS_DIR, "./logs/catdb/"); + } + } + + public static void main(String[] args) { + SpringApplication.run(CatalogDBApplication.class, args); + System.getProperties().setProperty("mso.db", "MARIADB"); + System.getProperties().setProperty("server.name", "Springboot"); + setLogsDir(); + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java new file mode 100644 index 0000000000..3906762e60 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb; + +import java.util.stream.Collectors; + +import javax.persistence.EntityManager; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; + +@Configuration +public class CatalogDbRepositoryConfiguration extends RepositoryRestConfigurerAdapter { + + @Autowired + private EntityManager entityManager; + + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) { + config.exposeIdsFor(entityManager.getMetamodel().getEntities().stream().map(e -> e.getJavaType()).collect(Collectors.toList()).toArray(new Class[0])); + } + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java new file mode 100644 index 0000000000..dcd668f2c8 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb; + +import javax.annotation.PostConstruct; +import javax.ws.rs.ApplicationPath; + +import org.glassfish.jersey.server.ResourceConfig; +import org.onap.so.adapters.catalogdb.rest.CatalogDbAdapterRest; +import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging; +import org.springframework.context.annotation.Configuration; + +import io.swagger.jaxrs.config.BeanConfig; +import io.swagger.jaxrs.listing.ApiListingResource; +import io.swagger.jaxrs.listing.SwaggerSerializers; + +@Configuration +@ApplicationPath("/ecomp/mso/catalog") +public class JerseyConfiguration extends ResourceConfig { + + @PostConstruct + public void setUp() { + register(CatalogDbAdapterRest.class); + register(ApiListingResource.class); + register(SwaggerSerializers.class); + register(JaxRsFilterLogging.class); + BeanConfig beanConfig = new BeanConfig(); + beanConfig.setVersion("1.0.2"); + beanConfig.setSchemes(new String[]{"http"}); + beanConfig.setHost("localhost:8080"); + beanConfig.setBasePath("/ecomp/mso/catalog"); + beanConfig.setResourcePackage("org.onap.so.adapters.catalogdb"); + beanConfig.setPrettyPrint(true); + beanConfig.setScan(true); + } +} + diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java new file mode 100644 index 0000000000..144df5fe6a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb; + +import org.onap.so.security.MSOSpringFirewall; +import org.onap.so.security.WebSecurityConfig; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.builders.WebSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.web.firewall.StrictHttpFirewall; +import org.springframework.util.StringUtils; + +@EnableWebSecurity +public class WebSecurityConfigImpl extends WebSecurityConfig { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.csrf().disable() + .authorizeRequests() + .antMatchers("/manage/health","/manage/info").permitAll() + .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString()) + .and() + .httpBasic(); + } + + @Override + public void configure(WebSecurity web) throws Exception { + super.configure(web); + StrictHttpFirewall firewall = new MSOSpringFirewall(); + web.httpFirewall(firewall); + } + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java new file mode 100644 index 0000000000..6b0d901cb4 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.databind.ObjectMapper; + +public abstract class CatalogQuery { + protected static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,CatalogQuery.class); + private static final boolean IS_EMBED = true; + + public abstract String JSON2(boolean isArray, boolean isEmbed); + + protected void put(Map valueMap, String key, String value) { + valueMap.put(key, value == null? "null": '"'+ value+ '"'); + } + + protected void put(Map valueMap, String key, Integer value) { + valueMap.put(key, value == null? "null": value.toString()); + } + + protected void put(Map valueMap, String key, Boolean value) { + valueMap.put(key, value == null? "null": value? "true": "false"); + } + + protected String setTemplate(String template, Map valueMap) { + LOGGER.debug("CatalogQuery setTemplate"); + StringBuffer result = new StringBuffer(); + + String pattern = "<.*>"; + Pattern r = Pattern.compile(pattern); + Matcher m = r.matcher(template); + + LOGGER.debug("CatalogQuery template:" + template); + while (m.find()) { + String key = template.substring(m.start() + 1, m.end() - 1); + LOGGER.debug("CatalogQuery key:" + key + " contains key? " + valueMap.containsKey(key)); + m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\"")); + } + m.appendTail(result); + LOGGER.debug("CatalogQuery return:" + result.toString()); + return result.toString(); + } + + /** + * The simple, clean, generic way to handle the interface + */ + protected String smartToJSON() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + jsonString = mapper.writeValueAsString(this); + } + catch (Exception e) { + LOGGER.debug("Exception:", e); + LOGGER.debug ("jsonString exception:"+e.getMessage()); + jsonString = "invalid"; //throws instead? + } + return jsonString; + } + + public String toJsonString(String version, boolean isArray) { + switch(version) { + case "v1": return smartToJSON(); + case "v2": return JSON2(isArray, !IS_EMBED); + default: + return "invalid version: "+ version; + } + } + @Override + public String toString(){ + return smartToJSON(); + + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryException.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryException.java new file mode 100644 index 0000000000..890347344c --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryException.java @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "catalogQueryException") +public class CatalogQueryException extends CatalogQueryExceptionCommon implements Serializable { + private static final long serialVersionUID = -9062290006520066109L; + + private String message; + private CatalogQueryExceptionCategory category; + private Boolean rolledBack; + + public CatalogQueryException () {} + + public CatalogQueryException (String message) { + this.message = message; + } + + public CatalogQueryException (String message, CatalogQueryExceptionCategory category, boolean rolledBack, String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + + public CatalogQueryExceptionCategory getCategory () { return category; } + public void setCategory (CatalogQueryExceptionCategory category) { this.category = category; } + + public Boolean getRolledBack() { return rolledBack; } + public void setRolledBack(Boolean rolledBack) { this.rolledBack = rolledBack; } + + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java new file mode 100644 index 0000000000..687cc7d3e0 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java @@ -0,0 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +public enum CatalogQueryExceptionCategory { OPENSTACK, IO, INTERNAL, USERDATA } diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java new file mode 100644 index 0000000000..67f337e039 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +public abstract class CatalogQueryExceptionCommon { + private String messageId; + protected static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,CatalogQueryExceptionCommon.class); + + public CatalogQueryExceptionCommon() { messageId = null; } + public CatalogQueryExceptionCommon(String messageId) { this.messageId = messageId; } + + public String getMessageId() { return messageId; } + public void setMessageId(String messageId) { this.messageId = messageId; } + + public String toJsonString() { + try { + String jsonString; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + LOGGER.debug ("Exception:", e); + return ""; + } + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + LOGGER.debug ("Exception:", e); + return ""; + } + } + + @Override + public String toString(){ + return toJsonString(); + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java new file mode 100644 index 0000000000..2deada5754 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.db.catalog.beans.AllottedResourceCustomization; +import org.onap.so.logger.MsoLogger; + +@XmlRootElement(name = "serviceAllottedResources") +public class QueryAllottedResourceCustomization extends CatalogQuery { + protected static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,QueryAllottedResourceCustomization.class); + private List allottedResourceCustomization; + private final String template = + "\t{\n"+ +// "\t{ \"allottedResource\" : {\n"+ + "\t\t\"modelInfo\" : {\n"+ + "\t\t\t\"modelName\" : ,\n"+ + "\t\t\t\"modelUuid\" : ,\n"+ + "\t\t\t\"modelInvariantUuid\" : ,\n"+ + "\t\t\t\"modelVersion\" : ,\n"+ + "\t\t\t\"modelCustomizationUuid\" : ,\n"+ + "\t\t\t\"modelInstanceName\" : \n"+ + "\t\t},\n"+ + "\t\t\"toscaNodeType\" : ,\n"+ + "\t\t\"allottedResourceType\" : ,\n"+ + "\t\t\"allottedResourceRole\" : ,\n"+ + "\t\t\"providingServiceModelName\" : ,\n"+ + "\t\t\"providingServiceModelInvariantUuid\" : ,\n"+ + "\t\t\"providingServiceModelUuid\" : ,\n"+ + "\t\t\"nfFunction\" : ,\n"+ + "\t\t\"nfType\" : ,\n"+ + "\t\t\"nfRole\" : ,\n"+ + "\t\t\"nfNamingCode\" : \n"+ + "\t}"; +// "\t}}"; + + public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<>(); } + public QueryAllottedResourceCustomization(List vlist) { allottedResourceCustomization = vlist; } + + public List getServiceAllottedResources(){ return this.allottedResourceCustomization; } + public void setServiceAllottedResources(List v) { this.allottedResourceCustomization = v; } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder(); + + boolean first = true; + int i = 1; + for (AllottedResourceCustomization o : allottedResourceCustomization) { + sb.append(i).append("\t"); + if (!first) sb.append("\n"); first = false; + sb.append(o); + } + return sb.toString(); + } + + @Override + public String JSON2(boolean isArray, boolean isEmbed) { + StringBuilder sb = new StringBuilder(); + if (!isEmbed && isArray) sb.append("{ "); + if (isArray) sb.append("\"serviceAllottedResources\": ["); + Map valueMap = new HashMap<>(); + String sep = ""; + boolean first = true; + + if (this.allottedResourceCustomization != null) { + for (AllottedResourceCustomization o : allottedResourceCustomization) { + if (first) sb.append("\n"); first = false; + + boolean arNull = o.getAllottedResource() == null ? true : false; + + put(valueMap, "MODEL_NAME", arNull ? null : o.getAllottedResource().getModelName()); + put(valueMap, "MODEL_UUID", arNull ? null : o.getAllottedResource().getModelUUID()); + put(valueMap, "MODEL_INVARIANT_ID", arNull ? null : o.getAllottedResource().getModelInvariantUUID()); + put(valueMap, "MODEL_VERSION", arNull ? null : o.getAllottedResource().getModelVersion()); + put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUUID()); + put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); + put(valueMap, "TOSCA_NODE_TYPE", arNull ? null : o.getAllottedResource().getToscaNodeType()); + put(valueMap, "ALLOTTED_RESOURCE_TYPE", arNull ? null : o.getAllottedResource().getSubcategory()); + put(valueMap, "ALLOTTED_RESOURCE_ROLE", o.getTargetNetworkRole()); + put(valueMap, "NF_TYPE", o.getNfType()); + put(valueMap, "NF_ROLE", o.getNfRole()); + put(valueMap, "NF_FUNCTION", o.getNfFunction()); + put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); + put(valueMap, "PROVIDING_SERVICE_MODEL_INVARIANT_UUID", o.getProvidingServiceModelInvariantUUID()); + put(valueMap, "PROVIDING_SERVICE_MODEL_UUID", o.getProvidingServiceModelUUID()); + put(valueMap, "PROVIDING_SERVICE_MODEL_NAME", o.getProvidingServiceModelName()); + + sb.append(sep).append(this.setTemplate(template, valueMap)); + sep = ",\n"; + } + } + if (!first) sb.append("\n"); + if (isArray) sb.append("]"); + if (!isEmbed && isArray) sb.append("}"); + return sb.toString(); + } + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipe.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipe.java new file mode 100644 index 0000000000..e0d187500e --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipe.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.HashMap; +import java.util.Map; + +import org.onap.so.db.catalog.beans.Recipe; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * serivce csar query support + *
+ *

+ *

+ * + * @author + * @version ONAP Beijing Release 2018-02-28 + */ +public class QueryResourceRecipe extends CatalogQuery{ + + private Recipe resourceRecipe; + + public QueryResourceRecipe(Recipe resourceRecipe){ + this.resourceRecipe =resourceRecipe; + } + + @Override + public String toString() { + + return resourceRecipe.toString(); + } + + @Override + public String JSON2(boolean isArray, boolean isEmbed) { + Map valueMap = new HashMap<>(); + valueMap.put("id", null == resourceRecipe ? null :String.valueOf(resourceRecipe.getId())); + valueMap.put("action", null == resourceRecipe ? null :resourceRecipe.getAction()); + valueMap.put("orchestrationUri", null == resourceRecipe ? null : resourceRecipe.getOrchestrationUri()); + valueMap.put("recipeTimeout", null == resourceRecipe ? null : String.valueOf(resourceRecipe.getRecipeTimeout())); + valueMap.put("paramXSD", null == resourceRecipe ? null : resourceRecipe.getParamXsd()); + valueMap.put("description", null == resourceRecipe ? null : resourceRecipe.getDescription()); + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); + String jsonStr = ""; + try { + jsonStr = mapper.writeValueAsString(valueMap); + } catch(JsonProcessingException e) { + + e.printStackTrace(); + } + return jsonStr; + } + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceCsar.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceCsar.java new file mode 100644 index 0000000000..d49f8965fb --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceCsar.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.HashMap; +import java.util.Map; + +import org.onap.so.db.catalog.beans.ToscaCsar; + +/** + * serivce csar query support + *
+ *

+ *

+ * + * @author + * @version ONAP Beijing Release 2018-02-28 + */ +public class QueryServiceCsar extends CatalogQuery{ + + private ToscaCsar toscaCsar; + + public QueryServiceCsar(ToscaCsar toscaCsar){ + this.toscaCsar = toscaCsar; + } + + private final String template = + "\t{\n"+ + "\t\t\"artifactUUID\" : ,\n"+ + "\t\t\"name\" : ,\n"+ + "\t\t\"version\" : ,\n"+ + "\t\t\"artifactChecksum\" : ,\n"+ + "\t\t\"url\" : ,\n"+ + "\t\t\"description\" : \n"+ + "\t}"; + + @Override + public String toString() { + + return toscaCsar.toString(); + } + + @Override + public String JSON2(boolean isArray, boolean isEmbed) { + Map valueMap = new HashMap<>(); + put(valueMap, "ARTIFACT_UUID", null == toscaCsar ? null : toscaCsar.getArtifactUUID()); + put(valueMap, "NAME", null == toscaCsar ? null : toscaCsar.getName()); + put(valueMap, "VERSION", null == toscaCsar ? null : toscaCsar.getVersion()); + put(valueMap, "ARTIFACT_CHECK_SUM", null == toscaCsar ? null : toscaCsar.getArtifactChecksum()); + put(valueMap, "URL", null == toscaCsar ? null : toscaCsar.getUrl()); + put(valueMap, "DESCRIPTION", null == toscaCsar ? null : toscaCsar.getDescription()); + return this.setTemplate(template, valueMap); + } + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java new file mode 100644 index 0000000000..12ba4c0598 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.db.catalog.beans.Service; +import org.onap.so.db.catalog.rest.beans.ServiceMacroHolder; + +@XmlRootElement(name = "serviceResources") +public class QueryServiceMacroHolder extends CatalogQuery { + private ServiceMacroHolder serviceMacroHolder; + private static final String LINE_BEGINNING = "(?m)^"; + private static final String template = + "{ \"serviceResources\" : {\n"+ + "\t\"modelInfo\" : {\n"+ + "\t\t\"modelName\" : ,\n"+ + "\t\t\"modelUuid\" : ,\n"+ + "\t\t\"modelInvariantUuid\" : ,\n"+ + "\t\t\"modelVersion\" : \n"+ + "\t},\n"+ + "\t\"serviceType\" : ,\n"+ + "\t\"serviceRole\" : ,\n"+ + "\t\"environmentContext\" : ,\n"+ + "\t\"workloadContext\" : ,\n"+ + "<_SERVICEVNFS_>,\n"+ + "<_SERVICENETWORKS_>,\n"+ + "<_SERVICEALLOTTEDRESOURCES_>\n"+ + "\t}}"; + + public QueryServiceMacroHolder() { + super(); + serviceMacroHolder = new ServiceMacroHolder(); + } + public QueryServiceMacroHolder(ServiceMacroHolder vlist) { serviceMacroHolder = vlist; } + + public ServiceMacroHolder getServiceResources(){ return this.serviceMacroHolder; } + public void setServiceResources(ServiceMacroHolder v) { this.serviceMacroHolder = v; } + + @Override + public String toString () { return serviceMacroHolder.toString(); } + + @Override + public String JSON2(boolean isArray, boolean x) { + Service service = serviceMacroHolder.getService(); + if (service == null) { + return "\"serviceResources\": null"; + } + + StringBuilder buf = new StringBuilder(); + Map valueMap = new HashMap<>(); + + put(valueMap, "SERVICE_MODEL_NAME", service.getModelName()); //getServiceModelName()); + put(valueMap, "SERVICE_MODEL_UUID", service.getModelUUID()); //getServiceModelUuid()); + put(valueMap, "SERVICE_MODEL_INVARIANT_ID", service.getModelInvariantUUID()); //getServiceModelInvariantId()); + put(valueMap, "SERVICE_MODEL_VERSION", service.getModelVersion()); //getServiceModelVersion()); + put(valueMap, "SERVICE_TYPE", service.getServiceType()); + put(valueMap, "SERVICE_ROLE", service.getServiceRole()); + put(valueMap, "ENVIRONMENT_CONTEXT", service.getEnvironmentContext()); + put(valueMap, "WORKLOAD_CONTEXT", service.getWorkloadContext()); + + String subitem; + subitem = new QueryServiceVnfs(service.getVnfCustomizations()).JSON2(true, true); + valueMap.put("_SERVICEVNFS_", subitem.replaceAll(LINE_BEGINNING, "\t")); + + subitem = new QueryServiceNetworks(service.getNetworkCustomizations()).JSON2(true, true); + valueMap.put("_SERVICENETWORKS_", subitem.replaceAll(LINE_BEGINNING, "\t")); + + subitem = new QueryAllottedResourceCustomization(service.getAllottedCustomizations()).JSON2(true, true); + valueMap.put("_SERVICEALLOTTEDRESOURCES_", subitem.replaceAll(LINE_BEGINNING, "\t")); + + buf.append(this.setTemplate(template, valueMap)); + return buf.toString(); + } + +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java new file mode 100644 index 0000000000..b213d33af0 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.db.catalog.beans.NetworkResourceCustomization; +import org.onap.so.logger.MsoLogger; + +@XmlRootElement(name = "serviceNetworks") +public class QueryServiceNetworks extends CatalogQuery { + protected static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,QueryServiceNetworks.class); + private List serviceNetworks; + private final String template = + "\t{\n"+ +// "\t{ \"networkResource\" : {\n"+ + "\t\t\"modelInfo\" : {\n"+ + "\t\t\t\"modelName\" : ,\n"+ + "\t\t\t\"modelUuid\" : ,\n"+ + "\t\t\t\"modelInvariantUuid\" : ,\n"+ + "\t\t\t\"modelVersion\" : ,\n"+ + "\t\t\t\"modelCustomizationUuid\" : ,\n"+ + "\t\t\t\"modelInstanceName\" : \n"+ + "\t},\n"+ + "\t\t\"toscaNodeType\" : ,\n"+ + "\t\t\"networkType\" : ,\n"+ + "\t\t\"networkTechnology\" : ,\n"+ + "\t\t\"networkRole\" : ,\n"+ + "\t\t\"networkScope\" : \n"+ + "\t}"; +// "\t}}"; + + public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<>(); } + public QueryServiceNetworks(List vlist) { + LOGGER.debug ("QueryServiceNetworks:"); + serviceNetworks = new ArrayList<>(); + for (NetworkResourceCustomization o : vlist) { + LOGGER.debug (o.toString()); + serviceNetworks.add(o); + LOGGER.debug ("-------------------"); + } + } + + public List getServiceNetworks(){ return this.serviceNetworks; } + public void setServiceNetworks(List v) { this.serviceNetworks = v; } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder(); + + boolean first = true; + int i = 1; + for (NetworkResourceCustomization o : serviceNetworks) { + sb.append(i).append("\t"); + if (!first) sb.append("\n"); first = false; + sb.append(o); + } + return sb.toString(); + } + + @Override + public String JSON2(boolean isArray, boolean isEmbed) { + StringBuilder sb = new StringBuilder(); + if (!isEmbed && isArray) sb.append("{ "); + if (isArray) sb.append("\"serviceNetworks\": ["); + + Map valueMap = new HashMap<>(); + String sep = ""; + boolean first = true; + + for (NetworkResourceCustomization o : serviceNetworks) { + if (first) sb.append("\n"); first = false; + boolean nrNull = o.getNetworkResource() == null ? true : false; + put(valueMap, "MODEL_NAME", nrNull ? null : o.getNetworkResource().getModelName()); + put(valueMap, "MODEL_UUID", nrNull ? null : o.getNetworkResource().getModelUUID()); + put(valueMap, "MODEL_INVARIANT_ID", nrNull ? null : o.getNetworkResource().getModelInvariantUUID()); + put(valueMap, "MODEL_VERSION", nrNull ? null : o.getNetworkResource().getModelVersion()); + put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUUID()); + put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); + put(valueMap, "TOSCA_NODE_TYPE", nrNull ? null : o.getNetworkResource().getToscaNodeType()); + put(valueMap, "NETWORK_TYPE", o.getNetworkType()); + put(valueMap, "NETWORK_ROLE", o.getNetworkRole()); + put(valueMap, "NETWORK_SCOPE", o.getNetworkScope()); + put(valueMap, "NETWORK_TECHNOLOGY", o.getNetworkTechnology()); + + sb.append(sep).append(this.setTemplate(template, valueMap)); + sep = ",\n"; + } + if (!first) sb.append("\n"); + if (isArray) sb.append("]"); + if (!isEmbed && isArray) sb.append("}"); + return sb.toString(); + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java new file mode 100644 index 0000000000..ff52daf880 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; +/* should be called QueryVnfResource.java */ + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.db.catalog.beans.VnfResourceCustomization; + +@XmlRootElement(name = "serviceVnfs") +public class QueryServiceVnfs extends CatalogQuery { + private List serviceVnfs; + private final String template = + "\n"+ + "\t{ \"modelInfo\" : {\n"+ + "\t\t\"modelName\" : ,\n"+ + "\t\t\"modelUuid\" : ,\n"+ + "\t\t\"modelInvariantUuid\" : ,\n"+ + "\t\t\"modelVersion\" : ,\n"+ + "\t\t\"modelCustomizationUuid\" : ,\n"+ + "\t\t\"modelInstanceName\" : \n"+ + "\t\t},\n"+ + "\t\"toscaNodeType\" : ,\n"+ + "\t\"nfFunction\" : ,\n"+ + "\t\"nfType\" : ,\n"+ + "\t\"nfRole\" : ,\n"+ + "\t\"nfNamingCode\" : ,\n"+ + "\t\"multiStageDesign\" : ,\n"+ + "<_VFMODULES_>\n" + + "\t}"; + + public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); } + public QueryServiceVnfs(List vlist) { + LOGGER.debug ("QueryServiceVnfs:"); + serviceVnfs = new ArrayList<>(); + for (VnfResourceCustomization o : vlist) { + LOGGER.debug ("-- o is a serviceVnfs ----"); + LOGGER.debug (o.toString()); + serviceVnfs.add(o); + LOGGER.debug ("-------------------"); + } + } + + public List getServiceVnfs(){ return this.serviceVnfs; } + public void setServiceVnfs(List v) { this.serviceVnfs = v; } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder(); + + boolean first = true; + int i = 1; + for (VnfResourceCustomization o : serviceVnfs) { + sb.append(i).append("\t"); + if (!first) sb.append("\n"); first = false; + sb.append(o); + } + return sb.toString(); + } + + @Override + public String JSON2(boolean isArray, boolean isEmbed) { + StringBuilder sb = new StringBuilder(); + if (!isEmbed && isArray) sb.append("{ "); + if (isArray) sb.append("\"serviceVnfs\": ["); + Map valueMap = new HashMap<>(); + String sep = ""; + boolean first = true; + + for (VnfResourceCustomization o : serviceVnfs) { + if (first) sb.append("\n"); first = false; + + boolean vrNull = o.getVnfResources() == null ? true : false; + + put(valueMap, "MODEL_NAME", vrNull ? null : o.getVnfResources().getModelName()); + put(valueMap, "MODEL_UUID", vrNull ? null : o.getVnfResources().getModelUUID()); + put(valueMap, "MODEL_INVARIANT_ID", vrNull ? null : o.getVnfResources().getModelInvariantId()); + put(valueMap, "MODEL_VERSION", vrNull ? null : o.getVnfResources().getModelVersion()); + put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUUID()); + put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); + put(valueMap, "TOSCA_NODE_TYPE", vrNull ? null : o.getVnfResources().getToscaNodeType()); + put(valueMap, "NF_FUNCTION", o.getNfFunction()); + put(valueMap, "NF_TYPE", o.getNfType()); + put(valueMap, "NF_ROLE", o.getNfRole()); + put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); + put(valueMap, "MULTI_STEP_DESIGN", o.getMultiStageDesign()); + + String subitem = new QueryVfModule(vrNull ? null : o.getVfModuleCustomizations()).JSON2(true, true); + valueMap.put("_VFMODULES_", subitem.replaceAll("(?m)^", "\t\t")); + + sb.append(sep).append(this.setTemplate(template, valueMap)); + sep = ",\n"; + } + if (!first) sb.append("\n"); + if (isArray) sb.append("]"); + if (!isEmbed && isArray) sb.append("}"); + return sb.toString(); + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVfModule.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVfModule.java new file mode 100644 index 0000000000..e5fa14376b --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVfModule.java @@ -0,0 +1,121 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.db.catalog.beans.HeatEnvironment; +import org.onap.so.db.catalog.beans.VfModuleCustomization; + +@XmlRootElement(name = "vfModules") +public class QueryVfModule extends CatalogQuery { + private List vfModules; + private final String template = + "\t{\n"+ +// "\t{ \"vfModule\" : { \n"+ + "\t\t\"modelInfo\" : { \n"+ + "\t\t\t\"modelName\" : ,\n"+ + "\t\t\t\"modelUuid\" : ,\n"+ + "\t\t\t\"modelInvariantUuid\" : ,\n"+ + "\t\t\t\"modelVersion\" : ,\n"+ + "\t\t\t\"modelCustomizationUuid\" : \n"+ + "\t\t},"+ + "\t\t\"isBase\" : ,\n"+ + "\t\t\"vfModuleLabel\" : ,\n"+ + "\t\t\"initialCount\" : ,\n"+ + "\t\t\"hasVolumeGroup\" : \n"+ + "\t}"; +// "\t}}"; + + public QueryVfModule() { super(); vfModules = new ArrayList<>(); } + public QueryVfModule(List vlist) { + LOGGER.debug ("QueryVfModule:"); + vfModules = new ArrayList<>(); + if (vlist != null) { + for (VfModuleCustomization o : vlist) { + LOGGER.debug ("-- o is a vfModules ----"); + LOGGER.debug (o.toString()); + vfModules.add(o); + LOGGER.debug ("-------------------"); + } + } + } + + public List getVfModule(){ return this.vfModules; } + public void setVfModule(List v) { this.vfModules = v; } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder(); + + boolean first = true; + int i = 1; + for (VfModuleCustomization o : vfModules) { + sb.append(i).append("\t"); + if (!first) sb.append("\n"); first = false; + sb.append(o); + } + return sb.toString(); + } + + @Override + public String JSON2(boolean isArray, boolean isEmbed) { + StringBuilder sb = new StringBuilder(); + if (!isEmbed && isArray) sb.append("{ "); + if (isArray) sb.append("\"vfModules\": ["); + Map valueMap = new HashMap<>(); + String sep = ""; + boolean first = true; + + for (VfModuleCustomization o : vfModules) { + if (first) sb.append("\n"); first = false; + + boolean vfNull = o.getVfModule() == null ? true : false; + boolean hasVolumeGroup = false; + HeatEnvironment envt = o.getVolumeHeatEnv(); + if (envt != null) { + hasVolumeGroup = true; + } + + put(valueMap, "MODEL_NAME", vfNull ? null : o.getVfModule().getModelName()); + put(valueMap, "MODEL_UUID", vfNull ? null : o.getVfModule().getModelUUID()); + put(valueMap, "MODEL_INVARIANT_ID", vfNull ? null : o.getVfModule().getModelInvariantUUID()); + put(valueMap, "MODEL_VERSION", vfNull ? null : o.getVfModule().getModelVersion()); + put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUUID()); + put(valueMap, "IS_BASE", vfNull ? false : o.getVfModule().getIsBase() ? true : false); + put(valueMap, "VF_MODULE_LABEL", o.getLabel()); + put(valueMap, "INITIAL_COUNT", o.getInitialCount()); + put(valueMap, "HAS_VOLUME_GROUP", new Boolean(hasVolumeGroup)); + + sb.append(sep).append(this.setTemplate(template, valueMap)); + sep = ",\n"; + } + if (!first) sb.append("\n"); + if (isArray) sb.append("]"); + if (!isEmbed && isArray) sb.append("}"); + return sb.toString(); + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java new file mode 100644 index 0000000000..0eeaa6a72c --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java @@ -0,0 +1,600 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.rest; + +/* +Create an initial query to retrieve a VNF Resource definition (including a list of possible module types) +within the context of a given service. Input is a vnf resource model customization ID (new field for 1702), +or a composite key (from 1610) of service name, service version, vnf instance name + +Returns a structure (JSON?) containing VNF RESOURCE attributes, plus a list of VF Module structures. + +Query a NETWORK_RESOURCE from the MSO Catalog, based on a networkModelCustomizationUUID (new for 1702), +a network type (unique type identifier in 1610), or based on network role within a service. + +Create Adapter framework for access to Catalog DB, including connection management, +login/password access, transaction logic, etc. This can be modeled after the Request DB Adapter + +Update the MSO Catalog DB schema to include the new fields defined in this user story. + +Note that the resourceModelCustomizationUUID (or vfModuleModelCustomizationUUID) will be unique keys (indexes) +on the VNF_RESOURCE and VF_MODULE tables respectively. +The previously constructed "vnf-type" and "vf-module-type" field may continue to be populated, +but should no longer be needed and can deprecate in future release. + +For migration, a new randomly generated UUID field may be generated for the *ModelCustomizationUUID" fields +until such time that the model is redistributed from ASDC. + +All other fields Check with Mike Z for appropriate value for the vfModuleLabel. +We might be able to derive it's value from the current vnf-type (using the "middle" piece that identifies the module type). + +min and initial counts can be 0. max can be null to indicate no maximum. + +Once the network-level distribution artifacts are defined, similar updates can be made to the NETWORK_RESOURCE table. +*/ + +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.GET; +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.GenericEntity; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.apache.http.HttpStatus; +import org.onap.so.adapters.catalogdb.catalogrest.CatalogQuery; +import org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryException; +import org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryExceptionCategory; +import org.onap.so.adapters.catalogdb.catalogrest.QueryAllottedResourceCustomization; +import org.onap.so.adapters.catalogdb.catalogrest.QueryResourceRecipe; +import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceCsar; +import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceMacroHolder; +import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceNetworks; +import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceVnfs; +import org.onap.so.adapters.catalogdb.catalogrest.QueryVfModule; +import org.onap.so.db.catalog.beans.AllottedResource; +import org.onap.so.db.catalog.beans.AllottedResourceCustomization; +import org.onap.so.db.catalog.beans.NetworkResource; +import org.onap.so.db.catalog.beans.NetworkResourceCustomization; +import org.onap.so.db.catalog.beans.Recipe; +import org.onap.so.db.catalog.beans.Service; +import org.onap.so.db.catalog.beans.ToscaCsar; +import org.onap.so.db.catalog.beans.VfModule; +import org.onap.so.db.catalog.beans.VfModuleCustomization; +import org.onap.so.db.catalog.beans.VnfResource; +import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository; +import org.onap.so.db.catalog.data.repository.AllottedResourceRepository; +import org.onap.so.db.catalog.data.repository.ArRecipeRepository; +import org.onap.so.db.catalog.data.repository.NetworkRecipeRepository; +import org.onap.so.db.catalog.data.repository.NetworkResourceCustomizationRepository; +import org.onap.so.db.catalog.data.repository.NetworkResourceRepository; +import org.onap.so.db.catalog.data.repository.ServiceRepository; +import org.onap.so.db.catalog.data.repository.ToscaCsarRepository; +import org.onap.so.db.catalog.data.repository.VFModuleRepository; +import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository; +import org.onap.so.db.catalog.data.repository.VnfRecipeRepository; +import org.onap.so.db.catalog.data.repository.VnfResourceRepository; +import org.onap.so.db.catalog.rest.beans.ServiceMacroHolder; +import org.onap.so.logger.MessageEnum; +import org.onap.so.logger.MsoLogger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +/** + * This class services calls to the REST interface for VF Modules (http://host:port/ecomp/mso/catalog/v1) + * Both XML and JSON can be produced/consumed. Set Accept: and Content-Type: headers appropriately. XML is the default. + * Requests respond synchronously only + */ +@Path("/{version: v[0-9]+}") +@Component +public class CatalogDbAdapterRest { + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,CatalogDbAdapterRest.class); + private static final boolean IS_ARRAY = true; + + @Autowired + private VnfCustomizationRepository vnfCustomizationRepo; + + @Autowired + private ServiceRepository serviceRepo; + + @Autowired + private NetworkResourceCustomizationRepository networkCustomizationRepo; + + @Autowired + private NetworkResourceRepository networkResourceRepo; + + @Autowired + private AllottedResourceCustomizationRepository allottedCustomizationRepo; + + @Autowired + private ToscaCsarRepository toscaCsarRepo; + + @Autowired + private VFModuleRepository vfModuleRepo; + + @Autowired + private VnfRecipeRepository vnfRecipeRepo; + + @Autowired + private NetworkRecipeRepository networkRecipeRepo; + + @Autowired + private ArRecipeRepository arRecipeRepo; + + @Autowired + private VnfResourceRepository vnfResourceRepo; + + @Autowired + private AllottedResourceRepository arResourceRepo; + + private static final String NO_MATCHING_PARAMETERS = "no matching parameters"; + + public Response respond(String version, int respStatus, boolean isArray, CatalogQuery qryResp) { + return Response + .status(respStatus) + //.entity(new GenericEntity(qryResp) {}) + .entity(qryResp.toJsonString(version, isArray)) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } + + @GET + @Path("vnfResources/{vnfModelCustomizationUuid}") + @Transactional( readOnly = true) + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + public Response serviceVnfs ( + @PathParam("version") String version, + @PathParam("vnfModelCustomizationUuid") String vnfUuid + ) { + return serviceVnfsImpl (version, !IS_ARRAY, vnfUuid, null, null, null, null); + } + + @GET + @Path("serviceVnfs") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional( readOnly = true) + public Response serviceVnfs( + @PathParam("version") String version, + @QueryParam("vnfModelCustomizationUuid") String vnfUuid, + @QueryParam("serviceModelUuid") String smUuid, + @QueryParam("serviceModelInvariantUuid") String smiUuid, + @QueryParam("serviceModelVersion") String smVer, + @QueryParam("serviceModelName") String smName + ) { + return serviceVnfsImpl (version, IS_ARRAY, vnfUuid, smUuid, smiUuid, smVer, smName); + } + + public Response serviceVnfsImpl(String version, boolean isArray, String vnfUuid, String serviceModelUUID, String smiUuid, String smVer, String smName) { + QueryServiceVnfs qryResp = null; + int respStatus = HttpStatus.SC_OK; + List ret = new ArrayList<>(); + Service service = null; + try { + if (vnfUuid != null && !"".equals(vnfUuid)) + ret = vnfCustomizationRepo.findByModelCustomizationUUID(vnfUuid); + else if (serviceModelUUID != null && !"".equals(serviceModelUUID)) + service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(serviceModelUUID); + else if (smiUuid != null && !"".equals(smiUuid)) + if (smVer != null && !"".equals(smVer)) + service = serviceRepo.findByModelVersionAndModelInvariantUUID(smVer,smiUuid); + else + service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(smiUuid); + else if (smName != null && !"".equals(smName)) { + if (smVer != null && !"".equals(smVer)) + service = serviceRepo.findByModelNameAndModelVersion(smName, smVer); + else + service = serviceRepo.findFirstByModelNameOrderByModelVersionDesc(smName); + } + else { + throw(new Exception(NO_MATCHING_PARAMETERS)); + } + + if (service == null && ret.isEmpty()) { + respStatus = HttpStatus.SC_NOT_FOUND; + qryResp = new QueryServiceVnfs(); + }else if( service == null && !ret.isEmpty()){ + qryResp = new QueryServiceVnfs(ret); + } else if (service != null) { + qryResp = new QueryServiceVnfs(service.getVnfCustomizations()); + } + LOGGER.debug ("serviceVnfs qryResp="+ qryResp); + return respond(version, respStatus, isArray, qryResp); + } catch (Exception e) { + LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, "", "", "queryServiceVnfs", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryServiceVnfs", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp) {}) + .build(); + } + } + + @GET + @Path("networkResources/{networkModelCustomizationUuid}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional( readOnly = true) + public Response serviceNetworks ( + @PathParam("version") String version, + @PathParam("networkModelCustomizationUuid") String nUuid + ) { + return serviceNetworksImpl (version, !IS_ARRAY, nUuid, null, null, null, null); + } + + @GET + @Path("serviceNetworks") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional( readOnly = true) + public Response serviceNetworks ( + @PathParam("version") String version, + @QueryParam("networkModelCustomizationUuid") String networkModelCustomizationUuid, + @QueryParam("networkType") String networkType, + @QueryParam("networkModelName") String networkModelName, + @QueryParam("serviceModelUuid") String serviceModelUuid, + @QueryParam("serviceModelInvariantUuid") String serviceModelInvariantUuid, + @QueryParam("serviceModelVersion") String serviceModelVersion, + @QueryParam("networkModelVersion") String networkModelVersion + ) { + if (networkModelName != null && !"".equals(networkModelName)) { + networkType = networkModelName; + } + return serviceNetworksImpl (version, IS_ARRAY, networkModelCustomizationUuid, networkType, serviceModelUuid, serviceModelInvariantUuid, serviceModelVersion); + } + + public Response serviceNetworksImpl (String version, boolean isArray, String networkModelCustomizationUuid, String networkType, String serviceModelUuid, String serviceModelInvariantUuid, String serviceModelVersion) { + QueryServiceNetworks qryResp; + int respStatus = HttpStatus.SC_OK; + String uuid = ""; + List ret = new ArrayList<>(); + Service service = null; + + try{ + if (networkModelCustomizationUuid != null && !"".equals(networkModelCustomizationUuid)) { + uuid = networkModelCustomizationUuid; + ret = networkCustomizationRepo.findByModelCustomizationUUID(networkModelCustomizationUuid); + }else if (networkType != null && !"".equals(networkType)) { + uuid = networkType; + NetworkResource networkResources = networkResourceRepo.findFirstByModelNameOrderByModelVersionDesc(networkType); + if(networkResources != null) + ret=networkResources.getNetworkResourceCustomization(); + } + else if (serviceModelInvariantUuid != null && !"".equals(serviceModelInvariantUuid)) { + uuid = serviceModelInvariantUuid; + if (serviceModelVersion != null && !"".equals(serviceModelVersion)) { + service = serviceRepo.findByModelVersionAndModelInvariantUUID(serviceModelVersion, uuid); + } + else { + service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid); + } + }else if (serviceModelUuid != null && !"".equals(serviceModelUuid)) { + uuid = serviceModelUuid; + service = serviceRepo.findOneByModelUUID(serviceModelUuid); + } + else { + throw(new Exception(NO_MATCHING_PARAMETERS)); + } + + if(service != null) + ret = service.getNetworkCustomizations(); + + if (ret == null || ret.isEmpty()) { + LOGGER.debug ("serviceNetworks not found"); + respStatus = HttpStatus.SC_NOT_FOUND; + qryResp = new QueryServiceNetworks(); + } else { + LOGGER.debug ("serviceNetworks found"); + qryResp = new QueryServiceNetworks(ret); + LOGGER.debug ("serviceNetworks qryResp="+ qryResp); + } + LOGGER.debug ("Query serviceNetworks exit"); + return respond(version, respStatus, isArray, qryResp); + } catch (Exception e) { + LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryServiceNetworks", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryServiceNetworks", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp) {}) + .build(); + } + } + + @GET + @Path("serviceResources") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional(readOnly = true) + public Response serviceResources( + @PathParam("version") String version, + @QueryParam("serviceModelUuid") String modelUUID, + @QueryParam("serviceModelInvariantUuid") String modelInvariantUUID, + @QueryParam("serviceModelVersion") String modelVersion) { + QueryServiceMacroHolder qryResp; + int respStatus = HttpStatus.SC_OK; + String uuid = ""; + ServiceMacroHolder ret = new ServiceMacroHolder(); + + try{ + if (modelUUID != null && !"".equals(modelUUID)) { + uuid = modelUUID; + LOGGER.debug ("Query serviceMacroHolder getAllResourcesByServiceModelUuid serviceModelUuid: " + uuid); + Service serv =serviceRepo.findOneByModelUUID(uuid); + ret.setService(serv); + } + else if (modelInvariantUUID != null && !"".equals(modelInvariantUUID)) { + uuid = modelInvariantUUID; + if (modelVersion != null && !"".equals(modelVersion)) { + LOGGER.debug ("Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelInvariantUuid: " + uuid+ " serviceModelVersion: "+ modelVersion); + Service serv = serviceRepo.findByModelVersionAndModelInvariantUUID(modelVersion, uuid); + ret.setService(serv); + } + else { + LOGGER.debug ("Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelUuid: " + uuid); + Service serv = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid); + ret.setService(serv); + } + } + else { + throw(new Exception(NO_MATCHING_PARAMETERS)); + } + + if (ret.getService() == null) { + LOGGER.debug ("serviceMacroHolder not found"); + respStatus = HttpStatus.SC_NOT_FOUND; + qryResp = new QueryServiceMacroHolder(); + } else { + LOGGER.debug ("serviceMacroHolder found"); + qryResp = new QueryServiceMacroHolder(ret); + LOGGER.debug ("serviceMacroHolder qryResp="+ qryResp); + } + LOGGER.debug ("Query serviceMacroHolder exit"); + return respond(version, respStatus, IS_ARRAY, qryResp); + } catch (Exception e) { + LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryServiceMacroHolder", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryServiceMacroHolder", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp){} ) + .build(); + } + } + + + @GET + @Path("allottedResources/{arModelCustomizationUuid}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional( readOnly = true) + public Response serviceAllottedResources ( + @PathParam("version") String version, + @PathParam("arModelCustomizationUuid") String aUuid + ) { + return serviceAllottedResourcesImpl(version, !IS_ARRAY, aUuid, null, null, null); + } + + @GET + @Path("serviceAllottedResources") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional( readOnly = true) + public Response serviceAllottedResources( + @PathParam("version") String version, + @QueryParam("serviceModelUuid") String smUuid, + @QueryParam("serviceModelInvariantUuid") String smiUuid, + @QueryParam("serviceModelVersion") String smVer, + @QueryParam("arModelCustomizationUuid") String aUuid + ) { + return serviceAllottedResourcesImpl(version, IS_ARRAY, aUuid, smUuid, smiUuid, smVer); + } + + public Response serviceAllottedResourcesImpl(String version, boolean isArray, String aUuid, String smUuid, String serviceModelInvariantUuid, String smVer) { + QueryAllottedResourceCustomization qryResp; + int respStatus = HttpStatus.SC_OK; + String uuid = ""; + List ret = new ArrayList<>(); + Service service = null; + try{ + if (smUuid != null && !"".equals(smUuid)) { + uuid = smUuid; + service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(uuid); + } + else if (serviceModelInvariantUuid != null && !"".equals(serviceModelInvariantUuid)) { + uuid = serviceModelInvariantUuid; + if (smVer != null && !"".equals(smVer)) { + service = serviceRepo.findByModelVersionAndModelInvariantUUID(smVer, uuid); + } + else { + service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid); + } + } + else if (aUuid != null && !"".equals(aUuid)) { + uuid = aUuid; + ret = allottedCustomizationRepo.findByModelCustomizationUUID(uuid); + } + else { + throw(new Exception(NO_MATCHING_PARAMETERS)); + } + + if(service != null) + ret=service.getAllottedCustomizations(); + + if (ret == null || ret.isEmpty()) { + LOGGER.debug ("AllottedResourceCustomization not found"); + respStatus = HttpStatus.SC_NOT_FOUND; + qryResp = new QueryAllottedResourceCustomization(); + } else { + qryResp = new QueryAllottedResourceCustomization(ret); + LOGGER.debug ("AllottedResourceCustomization qryResp="+ qryResp); + } + return respond(version, respStatus, isArray, qryResp); + } catch (Exception e) { + LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryAllottedResourceCustomization", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryAllottedResourceCustomization", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp) {}) + .build(); + } + } + + @GET + @Path("vfModules") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Transactional( readOnly = true) + public Response vfModules(@QueryParam("vfModuleModelName") String vfModuleModelName) { + QueryVfModule qryResp; + int respStatus = HttpStatus.SC_OK; + List ret = null; + try{ + if(vfModuleModelName != null && !"".equals(vfModuleModelName)){ + VfModule vfModule = vfModuleRepo.findFirstByModelNameOrderByModelVersionDesc(vfModuleModelName); + if(vfModule != null) + ret = vfModule.getVfModuleCustomization(); + }else{ + throw(new Exception(NO_MATCHING_PARAMETERS)); + } + + if(ret == null || ret.isEmpty()){ + LOGGER.debug ("vfModules not found"); + respStatus = HttpStatus.SC_NOT_FOUND; + qryResp = new QueryVfModule(); + }else{ + qryResp = new QueryVfModule(ret); + LOGGER.debug ("vfModules tojsonstring is: "+ qryResp.JSON2(false, false)); + } + return Response + .status(respStatus) + .entity(qryResp.JSON2(false, false)) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + }catch(Exception e){ + LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleModelName, "", "queryVfModules", MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query VfModules by vfModuleModuleName: ", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp) {}) + .build(); + } + } + /** + * Get the tosca csar info from catalog + *
+ * + * @param smUuid service model uuid + * @return the tosca csar information of the serivce. + * @since ONAP Beijing Release + */ + @GET + @Path("serviceToscaCsar") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + public Response serviceToscaCsar(@QueryParam("serviceModelUuid") String smUuid) { + int respStatus = HttpStatus.SC_OK; + String entity = ""; + try { + if (smUuid != null && !"".equals(smUuid)) { + LOGGER.debug("Query Csar by service model uuid: " + smUuid); + ToscaCsar toscaCsar = toscaCsarRepo.findOne(smUuid); + if (toscaCsar != null) { + QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar); + entity = serviceCsar.JSON2(false, false); + } else { + respStatus = HttpStatus.SC_NOT_FOUND; + } + } else { + throw (new Exception("Incoming parameter is null or blank")); + } + LOGGER.debug("Query Csar exit"); + return Response + .status(respStatus) + .entity(entity) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } catch (Exception e) { + LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, smUuid, "", "ServiceToscaCsar", + MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query csar by service model uuid: ", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), + CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp) { + }) + .build(); + } + } + + /** + * Get the resource recipe info from catalog + *
+ * + * @param rmUuid resource model uuid + * @return the recipe information of the resource. + * @since ONAP Beijing Release + */ + @GET + @Path("resourceRecipe") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + public Response resourceRecipe(@QueryParam("resourceModelUuid") String rmUuid, @QueryParam("action") String action) { + int respStatus = HttpStatus.SC_OK; + String entity = ""; + try { + if (rmUuid != null && !"".equals(rmUuid)) { + LOGGER.debug("Query recipe by resource model uuid: " + rmUuid); + //check vnf and network and ar, the resource could be any resource. + VnfResource vnf = vnfResourceRepo.findResourceByModelUUID(rmUuid); + Recipe recipe = vnfRecipeRepo.findVnfRecipeByNfRoleAndAction(vnf.getModelName(), action); + if (null == recipe) { + NetworkResource nResource = networkResourceRepo.findResourceByModelUUID(rmUuid); + recipe = networkRecipeRepo.findByModelNameAndAction(nResource.getModelName(), action); + } + if (null == recipe) { + AllottedResource arResource = arResourceRepo.findResourceByModelUUID(rmUuid); + recipe = arRecipeRepo.findByModelNameAndAction(arResource.getModelName(), action); + } + if (recipe != null) { + QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe); + entity = resourceRecipe.JSON2(false, false); + } else { + respStatus = HttpStatus.SC_NOT_FOUND; + } + } else { + throw (new Exception("Incoming parameter is null or blank")); + } + LOGGER.debug("Query recipe exit"); + return Response + .status(respStatus) + .entity(entity) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } catch (Exception e) { + LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, rmUuid, "", "resourceRecipe", + MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query recipe by resource model uuid: ", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), + CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response + .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity(excResp) { + }) + .build(); + } + } +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/package-info.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/package-info.java new file mode 100644 index 0000000000..8f75008aef --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/package-info.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +/** + * + */ +/** + * + * + */ + +package org.onap.so.adapters.catalogdb.rest; diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java deleted file mode 100644 index c1c5aee8f1..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java +++ /dev/null @@ -1,573 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb; - -/* -Create an initial query to retrieve a VNF Resource definition (including a list of possible module types) -within the context of a given service. Input is a vnf resource model customization ID (new field for 1702), -or a composite key (from 1610) of service name, service version, vnf instance name - -Returns a structure (JSON?) containing VNF RESOURCE attributes, plus a list of VF Module structures. - -Query a NETWORK_RESOURCE from the MSO Catalog, based on a networkModelCustomizationUUID (new for 1702), -a network type (unique type identifier in 1610), or based on network role within a service. - -Create Adapter framework for access to Catalog DB, including connection management, -login/password access, transaction logic, etc. This can be modeled after the Request DB Adapter - -Update the MSO Catalog DB schema to include the new fields defined in this user story. - -Note that the resourceModelCustomizationUUID (or vfModuleModelCustomizationUUID) will be unique keys (indexes) -on the VNF_RESOURCE and VF_MODULE tables respectively. -The previously constructed "vnf-type" and "vf-module-type" field may continue to be populated, -but should no longer be needed and can deprecate in future release. - -For migration, a new randomly generated UUID field may be generated for the *ModelCustomizationUUID" fields -until such time that the model is redistributed from ASDC. - -All other fields Check with Mike Z for appropriate value for the vfModuleLabel. -We might be able to derive it's value from the current vnf-type (using the "middle" piece that identifies the module type). - -min and initial counts can be 0. max can be null to indicate no maximum. - -Once the network-level distribution artifacts are defined, similar updates can be made to the NETWORK_RESOURCE table. -*/ - -import java.util.ArrayList; -import java.util.List; - -import javax.ws.rs.GET; -import javax.ws.rs.HEAD; -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.GenericEntity; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.apache.http.HttpStatus; -import org.openecomp.mso.adapters.catalogdb.catalogrest.CatalogQuery; -import org.openecomp.mso.adapters.catalogdb.catalogrest.CatalogQueryException; -import org.openecomp.mso.adapters.catalogdb.catalogrest.CatalogQueryExceptionCategory; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryAllottedResourceCustomization; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryResourceRecipe; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryServiceCsar; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryServiceMacroHolder; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryServiceNetworks; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryServiceVnfs; -import org.openecomp.mso.adapters.catalogdb.catalogrest.QueryVfModule; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization; -import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization; -import org.openecomp.mso.db.catalog.beans.Recipe; -import org.openecomp.mso.db.catalog.beans.ServiceMacroHolder; -import org.openecomp.mso.db.catalog.beans.ToscaCsar; -import org.openecomp.mso.db.catalog.beans.VfModuleCustomization; -import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; - -/** - * This class services calls to the REST interface for VF Modules (http://host:port/ecomp/mso/catalog/v1) - * Both XML and JSON can be produced/consumed. Set Accept: and Content-Type: headers appropriately. XML is the default. - * Requests respond synchronously only - */ -@Path("/{version: v[0-9]+}") -public class CatalogDbAdapterRest { - private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private static final boolean IS_ARRAY = true; - - public Response respond(String version, int respStatus, boolean isArray, CatalogQuery qryResp) { - return Response - .status(respStatus) - //.entity(new GenericEntity(qryResp) {}) - .entity(qryResp.toJsonString(version, isArray)) - .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) - .build(); - } - - @HEAD - @GET - @Path("healthcheck") - @Produces(MediaType.TEXT_HTML) - public Response healthcheck ( - @PathParam("version") String version - ) { - String CHECK_HTML = "Health CheckApplication "+ version+ " ready"; - return Response.ok().entity(CHECK_HTML).build(); - } - - @GET - @Path("vnfResources/{vnfModelCustomizationUuid}") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceVnfs ( - @PathParam("version") String version, - @PathParam("vnfModelCustomizationUuid") String vnfUuid - ) { - return serviceVnfsImpl (version, !IS_ARRAY, vnfUuid, null, null, null, null); - } - - @GET - @Path("serviceVnfs") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceVnfs( - @PathParam("version") String version, - @QueryParam("vnfModelCustomizationUuid") String vnfUuid, - @QueryParam("serviceModelUuid") String smUuid, - @QueryParam("serviceModelInvariantUuid") String smiUuid, - @QueryParam("serviceModelVersion") String smVer, - @QueryParam("serviceModelName") String smName - ) { - return serviceVnfsImpl (version, IS_ARRAY, vnfUuid, smUuid, smiUuid, smVer, smName); - } - - public Response serviceVnfsImpl(String version, boolean isArray, String vnfUuid, String smUuid, String smiUuid, String smVer, String smName) { - QueryServiceVnfs qryResp; - int respStatus = HttpStatus.SC_OK; - String uuid = ""; - List ret; - - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (vnfUuid != null && !"".equals(vnfUuid)) { - uuid = vnfUuid; - LOGGER.debug ("Query serviceVnfs getAllVnfsByVnfModelCustomizationUuid vnfModelCustomizationUuid: " + uuid); - ret = db.getAllVnfsByVnfModelCustomizationUuid(uuid); - } - else if (smUuid != null && !"".equals(smUuid)) { - uuid = smUuid; - LOGGER.debug ("Query serviceVnfs getAllVnfsByServiceModelUuid serviceModelUuid: " + uuid); - ret = db.getAllVnfsByServiceModelUuid(uuid); - } - else if (smiUuid != null && !"".equals(smiUuid)) { - uuid = smiUuid; - if (smVer != null && !"".equals(smVer)) { - LOGGER.debug ("Query serviceVnfs getAllNetworksByServiceModelInvariantUuid serviceModelInvariantUuid: " + uuid+ " serviceModelVersion: "+ smVer); - ret = db.getAllVnfsByServiceModelInvariantUuid(uuid, smVer); - } - else { - LOGGER.debug ("Query serviceVnfs getAllNetworksByServiceModelInvariantUuid serviceModelUuid: " + uuid); - ret = db.getAllVnfsByServiceModelInvariantUuid(uuid); - } - } - else if (smName != null && !"".equals(smName)) { - if (smVer != null && !"".equals(smVer)) { - LOGGER.debug ("Query serviceVnfs getAllVnfsByServiceName serviceModelInvariantName: " + smName+ " serviceModelVersion: "+ smVer); - ret = db.getAllVnfsByServiceName(smName, smVer); - } - else { - LOGGER.debug ("Query serviceVnfs getAllVnfsByServiceName serviceModelName: " + smName); - ret = db.getAllVnfsByServiceName(smName); - } - } - else { - throw(new Exception("no matching parameters")); - } - - if (ret == null || ret.isEmpty()) { - LOGGER.debug ("serviceVnfs not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - qryResp = new QueryServiceVnfs(); - } else { - LOGGER.debug ("serviceVnfs found"); - qryResp = new QueryServiceVnfs(ret); - LOGGER.debug ("serviceVnfs qryResp="+ qryResp); - } - LOGGER.debug ("Query serviceVnfs exit"); - return respond(version, respStatus, isArray, qryResp); - } catch (Exception e) { - LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryServiceVnfs", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryServiceVnfs", e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) {}) - .build(); - } - } - - @GET - @Path("networkResources/{networkModelCustomizationUuid}") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceNetworks ( - @PathParam("version") String version, - @PathParam("networkModelCustomizationUuid") String nUuid - ) { - return serviceNetworksImpl (version, !IS_ARRAY, nUuid, null, null, null, null); - } - - @GET - @Path("serviceNetworks") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceNetworks ( - @PathParam("version") String version, - @QueryParam("networkModelCustomizationUuid") String nUuid, - @QueryParam("networkType") String nType, - @QueryParam("networkModelName") String nModelName, - @QueryParam("serviceModelUuid") String smUuid, - @QueryParam("serviceModelInvariantUuid") String smiUuid, - @QueryParam("serviceModelVersion") String smVer, - @QueryParam("networkModelVersion") String nmVer - ) { - if (nModelName != null && !"".equals(nModelName)) { - nType = nModelName; - } - return serviceNetworksImpl (version, IS_ARRAY, nUuid, nType, smUuid, smiUuid, smVer); - } - - public Response serviceNetworksImpl (String version, boolean isArray, String nUuid, String nType, String smUuid, String smiUuid, String smVer) { - QueryServiceNetworks qryResp; - int respStatus = HttpStatus.SC_OK; - String uuid = ""; - List ret; - - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (nUuid != null && !"".equals(nUuid)) { - uuid = nUuid; - LOGGER.debug ("Query serviceNetworks getAllNetworksByNetworkModelCustomizationUuid networkModelCustomizationUuid: " + uuid); - ret = db.getAllNetworksByNetworkModelCustomizationUuid(uuid); - } - else if (smUuid != null && !"".equals(smUuid)) { - uuid = smUuid; - LOGGER.debug ("Query serviceNetworks getAllNetworksByServiceModelUuid serviceModelUuid: " + uuid); - ret = db.getAllNetworksByServiceModelUuid(uuid); - } - else if (nType != null && !"".equals(nType)) { - uuid = nType; - LOGGER.debug ("Query serviceNetworks getAllNetworksByNetworkType serviceModelUuid: " + uuid); - ret = db.getAllNetworksByNetworkType(uuid); - } - else if (smiUuid != null && !"".equals(smiUuid)) { - uuid = smiUuid; - if (smVer != null && !"".equals(smVer)) { - LOGGER.debug ("Query serviceNetworks getAllNetworksByServiceModelInvariantUuid serviceModelInvariantUuid: " + uuid+ " serviceModelVersion: "+ smVer); - ret = db.getAllNetworksByServiceModelInvariantUuid(uuid, smVer); - } - else { - LOGGER.debug ("Query serviceNetworks getAllNetworksByServiceModelInvariantUuid serviceModelUuid: " + uuid); - ret = db.getAllNetworksByServiceModelInvariantUuid(uuid); - } - } - else { - throw(new Exception("no matching parameters")); - } - - if (ret == null || ret.isEmpty()) { - LOGGER.debug ("serviceNetworks not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - qryResp = new QueryServiceNetworks(); - } else { - LOGGER.debug ("serviceNetworks found"); - qryResp = new QueryServiceNetworks(ret); - LOGGER.debug ("serviceNetworks qryResp="+ qryResp); - } - LOGGER.debug ("Query serviceNetworks exit"); - return respond(version, respStatus, isArray, qryResp); - } catch (Exception e) { - LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryServiceNetworks", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryServiceNetworks", e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) {}) - .build(); - } - } - - @GET - @Path("serviceResources") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceResources( - @PathParam("version") String version, - @QueryParam("serviceModelUuid") String smUuid, - @QueryParam("serviceModelInvariantUuid") String smiUuid, - @QueryParam("serviceModelVersion") String smVer) { - QueryServiceMacroHolder qryResp; - int respStatus = HttpStatus.SC_OK; - String uuid = ""; - ServiceMacroHolder ret; - - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (smUuid != null && !"".equals(smUuid)) { - uuid = smUuid; - LOGGER.debug ("Query serviceMacroHolder getAllResourcesByServiceModelUuid serviceModelUuid: " + uuid); - ret = db.getAllResourcesByServiceModelUuid(uuid); - } - else if (smiUuid != null && !"".equals(smiUuid)) { - uuid = smiUuid; - if (smVer != null && !"".equals(smVer)) { - LOGGER.debug ("Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelInvariantUuid: " + uuid+ " serviceModelVersion: "+ smVer); - ret = db.getAllResourcesByServiceModelInvariantUuid(uuid, smVer); - } - else { - LOGGER.debug ("Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelUuid: " + uuid); - ret = db.getAllResourcesByServiceModelInvariantUuid(uuid); - } - } - else { - throw(new Exception("no matching parameters")); - } - - if (ret == null) { - LOGGER.debug ("serviceMacroHolder not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - qryResp = new QueryServiceMacroHolder(); - } else { - LOGGER.debug ("serviceMacroHolder found"); - qryResp = new QueryServiceMacroHolder(ret); - LOGGER.debug ("serviceMacroHolder qryResp="+ qryResp); - } - LOGGER.debug ("Query serviceMacroHolder exit"); - return respond(version, respStatus, IS_ARRAY, qryResp); - } catch (Exception e) { - LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryServiceMacroHolder", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryServiceMacroHolder", e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) {}) - .build(); - } - } - - @GET - @Path("allottedResources/{arModelCustomizationUuid}") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceAllottedResources ( - @PathParam("version") String version, - @PathParam("arModelCustomizationUuid") String aUuid - ) { - return serviceAllottedResourcesImpl(version, !IS_ARRAY, aUuid, null, null, null); - } - - @GET - @Path("serviceAllottedResources") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceAllottedResources( - @PathParam("version") String version, - @QueryParam("serviceModelUuid") String smUuid, - @QueryParam("serviceModelInvariantUuid") String smiUuid, - @QueryParam("serviceModelVersion") String smVer, - @QueryParam("arModelCustomizationUuid") String aUuid - ) { - return serviceAllottedResourcesImpl(version, IS_ARRAY, aUuid, smUuid, smiUuid, smVer); - } - - public Response serviceAllottedResourcesImpl(String version, boolean isArray, String aUuid, String smUuid, String smiUuid, String smVer) { - QueryAllottedResourceCustomization qryResp; - int respStatus = HttpStatus.SC_OK; - String uuid = ""; - List ret; - - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (smUuid != null && !"".equals(smUuid)) { - uuid = smUuid; - LOGGER.debug ("Query AllottedResourceCustomization getAllAllottedResourcesByServiceModelUuid serviceModelUuid: " + uuid); - ret = db.getAllAllottedResourcesByServiceModelUuid(uuid); - } - else if (smiUuid != null && !"".equals(smiUuid)) { - uuid = smiUuid; - if (smVer != null && !"".equals(smVer)) { - LOGGER.debug ("Query AllottedResourceCustomization getAllAllottedResourcesByServiceModelInvariantUuid serviceModelInvariantUuid: " + uuid+ " serviceModelVersion: "+ smVer); - ret = db.getAllAllottedResourcesByServiceModelInvariantUuid(uuid, smVer); - } - else { - LOGGER.debug ("Query AllottedResourceCustomization getAllAllottedResourcesByServiceModelInvariantUuid serviceModelUuid: " + uuid); - ret = db.getAllAllottedResourcesByServiceModelInvariantUuid(uuid); - } - } - else if (aUuid != null && !"".equals(aUuid)) { - uuid = aUuid; - LOGGER.debug ("Query AllottedResourceCustomization getAllAllottedResourcesByArModelCustomizationUuid serviceModelUuid: " + uuid); - ret = db.getAllAllottedResourcesByArModelCustomizationUuid(uuid); - } - else { - throw(new Exception("no matching parameters")); - } - - if (ret == null || ret.isEmpty()) { - LOGGER.debug ("AllottedResourceCustomization not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - qryResp = new QueryAllottedResourceCustomization(); - } else { - LOGGER.debug ("AllottedResourceCustomization found"); - qryResp = new QueryAllottedResourceCustomization(ret); - LOGGER.debug ("AllottedResourceCustomization qryResp="+ qryResp); - } - LOGGER.debug ("Query AllottedResourceCustomization exit"); - return respond(version, respStatus, isArray, qryResp); - } catch (Exception e) { - LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, uuid, "", "queryAllottedResourceCustomization", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryAllottedResourceCustomization", e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) {}) - .build(); - } - } - - // Added for DHV in 1702. Might be a temporary solution! - // Changing to use QueryVfModule so the modelCustomizationUuid is included in response - @GET - @Path("vfModules") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response vfModules(@QueryParam("vfModuleModelName") String vfModuleModelName) { - QueryVfModule qryResp; - int respStatus = HttpStatus.SC_OK; - List ret = null; - - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (vfModuleModelName != null && !"".equals(vfModuleModelName)) { - LOGGER.debug("Query vfModules by vfModuleModuleName: " + vfModuleModelName); - VfModuleCustomization vfModule = db.getVfModuleCustomizationByModelName(vfModuleModelName); - if (vfModule != null) { - ret = new ArrayList<>(1); - ret.add(vfModule); - } - } else { - throw (new Exception("Incoming parameter is null or blank")); - } - if (ret == null || ret.isEmpty()) { - LOGGER.debug("vfModules not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - qryResp = new QueryVfModule(); - } else { - LOGGER.debug("vfModules found"); - qryResp = new QueryVfModule(ret); - LOGGER.debug("vfModules query Results is: " + qryResp); - LOGGER.debug("vfModules tojsonstring is: " + qryResp.JSON2(false, false)); - } - LOGGER.debug("Query vfModules exit"); - return Response - .status(respStatus) - .entity(qryResp.JSON2(false, false)) - .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) - .build(); - } catch (Exception e) { - LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, vfModuleModelName, "", "queryVfModules", - MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query VfModules by vfModuleModuleName: ", - e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), - CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) { - }) - .build(); - } - } - - /** - * Get the tosca csar info from catalog - *
- * - * @param smUuid service model uuid - * @return the tosca csar information of the serivce. - * @since ONAP Beijing Release - */ - @GET - @Path("serviceToscaCsar") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response serviceToscaCsar(@QueryParam("serviceModelUuid") String smUuid) { - int respStatus = HttpStatus.SC_OK; - String entity = ""; - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (smUuid != null && !"".equals(smUuid)) { - LOGGER.debug("Query Csar by service model uuid: " + smUuid); - ToscaCsar toscaCsar = db.getToscaCsarByServiceModelUUID(smUuid); - if (toscaCsar != null) { - QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar); - entity = serviceCsar.JSON2(false, false); - } else { - respStatus = HttpStatus.SC_NOT_FOUND; - } - } else { - throw (new Exception("Incoming parameter is null or blank")); - } - LOGGER.debug("Query Csar exit"); - return Response - .status(respStatus) - .entity(entity) - .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) - .build(); - } catch (Exception e) { - LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, smUuid, "", "ServiceToscaCsar", - MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query csar by service model uuid: ", e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), - CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) { - }) - .build(); - } - } - - /** - * Get the resource recipe info from catalog - *
- * - * @param rmUuid resource model uuid - * @return the recipe information of the resource. - * @since ONAP Beijing Release - */ - @GET - @Path("resourceRecipe") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public Response resourceRecipe(@QueryParam("resourceModelUuid") String rmUuid, @QueryParam("action") String action) { - int respStatus = HttpStatus.SC_OK; - String entity = ""; - try (CatalogDatabase db = CatalogDatabase.getInstance()) { - if (rmUuid != null && !"".equals(rmUuid)) { - LOGGER.debug("Query recipe by resource model uuid: " + rmUuid); - //check vnf and network and ar, the resource could be any resource. - Recipe recipe = db.getVnfRecipeByModuleUuid(rmUuid, action); - if (null == recipe) { - recipe = db.getNetworkRecipeByModuleUuid(rmUuid, action); - } - if (null == recipe) { - recipe = db.getArRecipeByModuleUuid(rmUuid, action); - } - if (recipe != null) { - QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe); - entity = resourceRecipe.JSON2(false, false); - } else { - respStatus = HttpStatus.SC_NOT_FOUND; - } - } else { - throw (new Exception("Incoming parameter is null or blank")); - } - LOGGER.debug("Query recipe exit"); - return Response - .status(respStatus) - .entity(entity) - .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) - .build(); - } catch (Exception e) { - LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, rmUuid, "", "resourceRecipe", - MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query recipe by resource model uuid: ", e); - CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), - CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response - .status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity(excResp) { - }) - .build(); - } - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java deleted file mode 100644 index 10d76f145b..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java +++ /dev/null @@ -1,92 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import org.openecomp.mso.logger.MsoLogger; -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public abstract class CatalogQuery { - protected static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private static final boolean IS_EMBED = true; - - public abstract String JSON2(boolean isArray, boolean isEmbed); - - protected void put(Map valueMap, String key, String value) { - valueMap.put(key, value == null? "null": '"'+ value+ '"'); - } - - protected void put(Map valueMap, String key, Integer value) { - valueMap.put(key, value == null? "null": value.toString()); - } - - protected void put(Map valueMap, String key, Boolean value) { - valueMap.put(key, value == null? "null": value? "true": "false"); - } - - protected String setTemplate(String template, Map valueMap) { - LOGGER.debug("CatalogQuery setTemplate"); - StringBuffer result = new StringBuffer(); - - String pattern = "<.*>"; - Pattern r = Pattern.compile(pattern); - Matcher m = r.matcher(template); - - LOGGER.debug("CatalogQuery template:" + template); - while (m.find()) { - String key = template.substring(m.start() + 1, m.end() - 1); - LOGGER.debug("CatalogQuery key:" + key + " contains key? " + valueMap.containsKey(key)); - m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\"")); - } - m.appendTail(result); - LOGGER.debug("CatalogQuery return:" + result.toString()); - return result.toString(); - } - - /** - * The simple, clean, generic way to handle the interface - */ - protected String smartToJSON() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - jsonString = mapper.writeValueAsString(this); - } - catch (Exception e) { - LOGGER.debug("Exception:", e); - LOGGER.debug ("jsonString exception:"+e.getMessage()); - jsonString = "invalid"; //throws instead? - } - return jsonString; - } - - public String toJsonString(String version, boolean isArray) { - switch(version) { - case "v1": return smartToJSON(); - case "v2": return JSON2(isArray, !IS_EMBED); - default: - return "invalid version: "+ version; - } - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java deleted file mode 100644 index a35bc78229..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import javax.xml.bind.annotation.XmlRootElement; -import java.io.Serializable; - -@XmlRootElement(name = "catalogQueryException") -public class CatalogQueryException extends CatalogQueryExceptionCommon implements Serializable { - private static final long serialVersionUID = -9062290006520066109L; - - private String message; - private CatalogQueryExceptionCategory category; - private Boolean rolledBack; - - public CatalogQueryException () {} - - public CatalogQueryException (String message) { - this.message = message; - } - - public CatalogQueryException (String message, CatalogQueryExceptionCategory category, boolean rolledBack, String messageid) { - super(messageid); - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - public CatalogQueryExceptionCategory getCategory () { return category; } - public void setCategory (CatalogQueryExceptionCategory category) { this.category = category; } - - public Boolean getRolledBack() { return rolledBack; } - public void setRolledBack(Boolean rolledBack) { this.rolledBack = rolledBack; } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java deleted file mode 100644 index 2364ccc667..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCategory.java +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -public enum CatalogQueryExceptionCategory { OPENSTACK, IO, INTERNAL, USERDATA } diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java deleted file mode 100644 index a1414e08bd..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import java.io.ByteArrayOutputStream; -import org.openecomp.mso.logger.MsoLogger; - -public abstract class CatalogQueryExceptionCommon { - private String messageId; - protected static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - public CatalogQueryExceptionCommon() { messageId = null; } - public CatalogQueryExceptionCommon(String messageId) { this.messageId = messageId; } - - public String getMessageId() { return messageId; } - public void setMessageId(String messageId) { this.messageId = messageId; } - - public String toJsonString() { - try { - String jsonString; - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - return jsonString; - } catch (Exception e) { - LOGGER.debug ("Exception:", e); - return ""; - } - } - - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - LOGGER.debug ("Exception:", e); - return ""; - } - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java deleted file mode 100644 index b249b58d48..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization; - -import javax.xml.bind.annotation.XmlRootElement; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@XmlRootElement(name = "serviceAllottedResources") -public class QueryAllottedResourceCustomization extends CatalogQuery { - private List allottedResourceCustomization; - private final String template = - "\t{\n"+ -// "\t{ \"allottedResource\" : {\n"+ - "\t\t\"modelInfo\" : {\n"+ - "\t\t\t\"modelName\" : ,\n"+ - "\t\t\t\"modelUuid\" : ,\n"+ - "\t\t\t\"modelInvariantUuid\" : ,\n"+ - "\t\t\t\"modelVersion\" : ,\n"+ - "\t\t\t\"modelCustomizationUuid\" : ,\n"+ - "\t\t\t\"modelInstanceName\" : \n"+ - "\t\t},\n"+ - "\t\t\"toscaNodeType\" : ,\n"+ - "\t\t\"allottedResourceType\" : ,\n"+ - "\t\t\"allottedResourceRole\" : ,\n"+ - "\t\t\"providingServiceModelName\" : ,\n"+ - "\t\t\"providingServiceModelInvariantUuid\" : ,\n"+ - "\t\t\"providingServiceModelUuid\" : ,\n"+ - "\t\t\"nfFunction\" : ,\n"+ - "\t\t\"nfType\" : ,\n"+ - "\t\t\"nfRole\" : ,\n"+ - "\t\t\"nfNamingCode\" : \n"+ - "\t}"; -// "\t}}"; - - public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<>(); } - public QueryAllottedResourceCustomization(List vlist) { allottedResourceCustomization = vlist; } - - public List getServiceAllottedResources(){ return this.allottedResourceCustomization; } - public void setServiceAllottedResources(List v) { this.allottedResourceCustomization = v; } - - @Override - public String toString () { - StringBuilder sb = new StringBuilder(); - - boolean first = true; - int i = 1; - for (AllottedResourceCustomization o : allottedResourceCustomization) { - sb.append(i).append("\t"); - if (!first) sb.append("\n"); first = false; - sb.append(o); - } - return sb.toString(); - } - - @Override - public String JSON2(boolean isArray, boolean isEmbed) { - StringBuilder sb = new StringBuilder(); - if (!isEmbed && isArray) sb.append("{ "); - if (isArray) sb.append("\"serviceAllottedResources\": ["); - Map valueMap = new HashMap<>(); - String sep = ""; - boolean first = true; - - if (this.allottedResourceCustomization != null) { - for (AllottedResourceCustomization o : allottedResourceCustomization) { - if (first) sb.append("\n"); first = false; - - boolean arNull = o.getAllottedResource() == null ? true : false; - - put(valueMap, "MODEL_NAME", arNull ? null : o.getAllottedResource().getModelName()); - put(valueMap, "MODEL_UUID", arNull ? null : o.getAllottedResource().getModelUuid()); - put(valueMap, "MODEL_INVARIANT_ID", arNull ? null : o.getAllottedResource().getModelInvariantUuid()); - put(valueMap, "MODEL_VERSION", arNull ? null : o.getAllottedResource().getModelVersion()); - put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUuid()); - put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); - put(valueMap, "TOSCA_NODE_TYPE", arNull ? null : o.getAllottedResource().getToscaNodeType()); - put(valueMap, "ALLOTTED_RESOURCE_TYPE", o.getNfType()); - put(valueMap, "ALLOTTED_RESOURCE_ROLE", o.getNfRole()); - put(valueMap, "NF_TYPE", o.getNfType()); - put(valueMap, "NF_ROLE", o.getNfRole()); - put(valueMap, "NF_FUNCTION", o.getNfFunction()); - put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); - put(valueMap, "PROVIDING_SERVICE_MODEL_INVARIANT_UUID", o.getProvidingServiceModelInvariantUuid()); - put(valueMap, "PROVIDING_SERVICE_MODEL_UUID", o.getProvidingServiceModelUuid()); - put(valueMap, "PROVIDING_SERVICE_MODEL_NAME", o.getProvidingServiceModelName()); - - sb.append(sep).append(this.setTemplate(template, valueMap)); - sep = ",\n"; - } - } - if (!first) sb.append("\n"); - if (isArray) sb.append("]"); - if (!isEmbed && isArray) sb.append("}"); - return sb.toString(); - } - -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java deleted file mode 100644 index 4d8b65a0c8..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import java.util.HashMap; -import java.util.Map; - -import org.openecomp.mso.db.catalog.beans.Recipe; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * serivce csar query support - *
- *

- *

- * - * @author - * @version ONAP Beijing Release 2018-02-28 - */ -public class QueryResourceRecipe extends CatalogQuery{ - - private Recipe resourceRecipe; - - public QueryResourceRecipe(Recipe resourceRecipe){ - this.resourceRecipe =resourceRecipe; - } - - @Override - public String toString() { - - return resourceRecipe.toString(); - } - - @Override - public String JSON2(boolean isArray, boolean isEmbed) { - - Map valueMap = new HashMap<>(); - valueMap.put("id", null == resourceRecipe ? null :String.valueOf(resourceRecipe.getId())); - valueMap.put("action", null == resourceRecipe ? null :resourceRecipe.getAction()); - valueMap.put("orchestrationUri", null == resourceRecipe ? null : resourceRecipe.getOrchestrationUri()); - valueMap.put("recipeTimeout", null == resourceRecipe ? null : String.valueOf(resourceRecipe.getRecipeTimeout())); - valueMap.put("paramXSD", null == resourceRecipe ? null : resourceRecipe.getParamXSD()); - valueMap.put("description", null == resourceRecipe ? null : resourceRecipe.getDescription()); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); - String jsonStr = ""; - try { - jsonStr = mapper.writeValueAsString(valueMap); - } catch(JsonProcessingException e) { - LOGGER.error("JsonProcessingException", e); - } - return jsonStr; - } - -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsar.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsar.java deleted file mode 100644 index 6b1eb836d9..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsar.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import java.util.HashMap; -import java.util.Map; - -import org.openecomp.mso.db.catalog.beans.ToscaCsar; - -/** - * serivce csar query support - *
- *

- *

- * - * @author - * @version ONAP Beijing Release 2018-02-28 - */ -public class QueryServiceCsar extends CatalogQuery{ - - private ToscaCsar toscaCsar; - - public QueryServiceCsar(ToscaCsar toscaCsar){ - this.toscaCsar = toscaCsar; - } - - private final String template = - "\t{\n"+ - "\t\t\"artifactUUID\" : ,\n"+ - "\t\t\"name\" : ,\n"+ - "\t\t\"version\" : ,\n"+ - "\t\t\"artifactChecksum\" : ,\n"+ - "\t\t\"url\" : ,\n"+ - "\t\t\"description\" : \n"+ - "\t}"; - - @Override - public String toString() { - - return toscaCsar.toString(); - } - - @Override - public String JSON2(boolean isArray, boolean isEmbed) { - Map valueMap = new HashMap<>(); - put(valueMap, "ARTIFACT_UUID", null == toscaCsar ? null : toscaCsar.getArtifactUUID()); - put(valueMap, "NAME", null == toscaCsar ? null : toscaCsar.getName()); - put(valueMap, "VERSION", null == toscaCsar ? null : toscaCsar.getVersion()); - put(valueMap, "ARTIFACT_CHECK_SUM", null == toscaCsar ? null : toscaCsar.getArtifactChecksum()); - put(valueMap, "URL", null == toscaCsar ? null : toscaCsar.getUrl()); - put(valueMap, "DESCRIPTION", null == toscaCsar ? null : toscaCsar.getDescription()); - return this.setTemplate(template, valueMap); - } - -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java deleted file mode 100644 index e683a9fd8d..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import org.openecomp.mso.db.catalog.beans.Service; -import org.openecomp.mso.db.catalog.beans.ServiceMacroHolder; - -import javax.xml.bind.annotation.XmlRootElement; -import java.util.HashMap; -import java.util.Map; - -@XmlRootElement(name = "serviceResources") -public class QueryServiceMacroHolder extends CatalogQuery { - private ServiceMacroHolder serviceMacroHolder; - private static final String LINE_BEGINNING = "(?m)^"; - private static final String template = - "{ \"serviceResources\" : {\n"+ - "\t\"modelInfo\" : {\n"+ - "\t\t\"modelName\" : ,\n"+ - "\t\t\"modelUuid\" : ,\n"+ - "\t\t\"modelInvariantUuid\" : ,\n"+ - "\t\t\"modelVersion\" : \n"+ - "\t},\n"+ - "\t\"serviceType\" : ,\n"+ - "\t\"serviceRole\" : ,\n"+ - "\t\"environmentContext\" : ,\n"+ - "\t\"workloadContext\" : ,\n"+ - "<_SERVICEVNFS_>,\n"+ - "<_SERVICENETWORKS_>,\n"+ - "<_SERVICEALLOTTEDRESOURCES_>\n"+ - "\t}}"; - - public QueryServiceMacroHolder() { - super(); - serviceMacroHolder = new ServiceMacroHolder(); - } - public QueryServiceMacroHolder(ServiceMacroHolder vlist) { serviceMacroHolder = vlist; } - - public ServiceMacroHolder getServiceResources(){ return this.serviceMacroHolder; } - public void setServiceResources(ServiceMacroHolder v) { this.serviceMacroHolder = v; } - - @Override - public String toString () { return serviceMacroHolder.toString(); } - - @Override - public String JSON2(boolean isArray, boolean x) { - Service service = serviceMacroHolder.getService(); - if (service == null) { - return "\"serviceResources\": null"; - } - - StringBuilder buf = new StringBuilder(); - Map valueMap = new HashMap<>(); - - put(valueMap, "SERVICE_MODEL_NAME", service.getModelName()); //getServiceModelName()); - put(valueMap, "SERVICE_MODEL_UUID", service.getModelUUID()); //getServiceModelUuid()); - put(valueMap, "SERVICE_MODEL_INVARIANT_ID", service.getModelInvariantUUID()); //getServiceModelInvariantId()); - put(valueMap, "SERVICE_MODEL_VERSION", service.getVersion()); //getServiceModelVersion()); - put(valueMap, "SERVICE_TYPE", service.getServiceType()); - put(valueMap, "SERVICE_ROLE", service.getServiceRole()); - put(valueMap, "ENVIRONMENT_CONTEXT", service.getEnvironmentContext()); - put(valueMap, "WORKLOAD_CONTEXT", service.getWorkloadContext()); - - String subitem; - subitem = new QueryServiceVnfs(serviceMacroHolder.getVnfResourceCustomizations()).JSON2(true, true); - valueMap.put("_SERVICEVNFS_", subitem.replaceAll(LINE_BEGINNING, "\t")); - - subitem = new QueryServiceNetworks(serviceMacroHolder.getNetworkResourceCustomization()).JSON2(true, true); - valueMap.put("_SERVICENETWORKS_", subitem.replaceAll(LINE_BEGINNING, "\t")); - - subitem = new QueryAllottedResourceCustomization(serviceMacroHolder.getAllottedResourceCustomization()).JSON2(true, true); - valueMap.put("_SERVICEALLOTTEDRESOURCES_", subitem.replaceAll(LINE_BEGINNING, "\t")); - - buf.append(this.setTemplate(template, valueMap)); - return buf.toString(); - } - -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java deleted file mode 100644 index 9795deec54..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java +++ /dev/null @@ -1,113 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization; - -import javax.xml.bind.annotation.XmlRootElement; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@XmlRootElement(name = "serviceNetworks") -public class QueryServiceNetworks extends CatalogQuery { - private List serviceNetworks; - private final String template = - "\t{\n"+ -// "\t{ \"networkResource\" : {\n"+ - "\t\t\"modelInfo\" : {\n"+ - "\t\t\t\"modelName\" : ,\n"+ - "\t\t\t\"modelUuid\" : ,\n"+ - "\t\t\t\"modelInvariantUuid\" : ,\n"+ - "\t\t\t\"modelVersion\" : ,\n"+ - "\t\t\t\"modelCustomizationUuid\" : ,\n"+ - "\t\t\t\"modelInstanceName\" : \n"+ - "\t},\n"+ - "\t\t\"toscaNodeType\" : ,\n"+ - "\t\t\"networkType\" : ,\n"+ - "\t\t\"networkTechnology\" : ,\n"+ - "\t\t\"networkRole\" : ,\n"+ - "\t\t\"networkScope\" : \n"+ - "\t}"; -// "\t}}"; - - public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<>(); } - public QueryServiceNetworks(List vlist) { - LOGGER.debug ("QueryServiceNetworks:"); - serviceNetworks = new ArrayList<>(); - for (NetworkResourceCustomization o : vlist) { - LOGGER.debug (o.toString()); - serviceNetworks.add(o); - LOGGER.debug ("-------------------"); - } - } - - public List getServiceNetworks(){ return this.serviceNetworks; } - public void setServiceNetworks(List v) { this.serviceNetworks = v; } - - @Override - public String toString () { - StringBuilder sb = new StringBuilder(); - - boolean first = true; - int i = 1; - for (NetworkResourceCustomization o : serviceNetworks) { - sb.append(i).append("\t"); - if (!first) sb.append("\n"); first = false; - sb.append(o); - } - return sb.toString(); - } - - @Override - public String JSON2(boolean isArray, boolean isEmbed) { - StringBuilder sb = new StringBuilder(); - if (!isEmbed && isArray) sb.append("{ "); - if (isArray) sb.append("\"serviceNetworks\": ["); - - Map valueMap = new HashMap<>(); - String sep = ""; - boolean first = true; - - for (NetworkResourceCustomization o : serviceNetworks) { - if (first) sb.append("\n"); first = false; - boolean nrNull = o.getNetworkResource() == null ? true : false; - put(valueMap, "MODEL_NAME", nrNull ? null : o.getNetworkResource().getModelName()); - put(valueMap, "MODEL_UUID", nrNull ? null : o.getNetworkResource().getModelUUID()); - put(valueMap, "MODEL_INVARIANT_ID", nrNull ? null : o.getNetworkResource().getModelInvariantUUID()); - put(valueMap, "MODEL_VERSION", nrNull ? null : o.getNetworkResource().getVersion()); - put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUuid()); - put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); - put(valueMap, "TOSCA_NODE_TYPE", nrNull ? null : o.getNetworkResource().getToscaNodeType()); - put(valueMap, "NETWORK_TYPE", o.getNetworkType()); - put(valueMap, "NETWORK_ROLE", o.getNetworkRole()); - put(valueMap, "NETWORK_SCOPE", o.getNetworkScope()); - put(valueMap, "NETWORK_TECHNOLOGY", o.getNetworkTechnology()); - - sb.append(sep).append(this.setTemplate(template, valueMap)); - sep = ",\n"; - } - if (!first) sb.append("\n"); - if (isArray) sb.append("]"); - if (!isEmbed && isArray) sb.append("}"); - return sb.toString(); - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java deleted file mode 100644 index 383a106b18..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; -/* should be called QueryVnfResource.java */ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; - -@XmlRootElement(name = "serviceVnfs") -public class QueryServiceVnfs extends CatalogQuery { - private List serviceVnfs; - private final String template = - "\n"+ - "\t{ \"modelInfo\" : {\n"+ - "\t\t\"modelName\" : ,\n"+ - "\t\t\"modelUuid\" : ,\n"+ - "\t\t\"modelInvariantUuid\" : ,\n"+ - "\t\t\"modelVersion\" : ,\n"+ - "\t\t\"modelCustomizationUuid\" : ,\n"+ - "\t\t\"modelInstanceName\" : \n"+ - "\t\t},\n"+ - "\t\"toscaNodeType\" : ,\n"+ - "\t\"nfFunction\" : ,\n"+ - "\t\"nfType\" : ,\n"+ - "\t\"nfRole\" : ,\n"+ - "\t\"nfNamingCode\" : ,\n"+ - "\t\"multiStageDesign\" : ,\n"+ - "<_VFMODULES_>\n" + - "\t}"; - - public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); } - public QueryServiceVnfs(List vlist) { - LOGGER.debug ("QueryServiceVnfs:"); - serviceVnfs = new ArrayList<>(); - for (VnfResourceCustomization o : vlist) { - LOGGER.debug ("-- o is a serviceVnfs ----"); - LOGGER.debug (o.toString()); - serviceVnfs.add(o); - LOGGER.debug ("-------------------"); - } - } - - public List getServiceVnfs(){ return this.serviceVnfs; } - public void setServiceVnfs(List v) { this.serviceVnfs = v; } - - @Override - public String toString () { - StringBuilder sb = new StringBuilder(); - - boolean first = true; - int i = 1; - for (VnfResourceCustomization o : serviceVnfs) { - sb.append(i).append("\t"); - if (!first) sb.append("\n"); first = false; - sb.append(o); - } - return sb.toString(); - } - - @Override - public String JSON2(boolean isArray, boolean isEmbed) { - StringBuilder sb = new StringBuilder(); - if (!isEmbed && isArray) sb.append("{ "); - if (isArray) sb.append("\"serviceVnfs\": ["); - Map valueMap = new HashMap<>(); - String sep = ""; - boolean first = true; - - for (VnfResourceCustomization o : serviceVnfs) { - if (first) sb.append("\n"); first = false; - - boolean vrNull = o.getVnfResource() == null ? true : false; - - put(valueMap, "MODEL_NAME", vrNull ? null : o.getVnfResource().getModelName()); - put(valueMap, "MODEL_UUID", vrNull ? null : o.getVnfResource().getModelUuid()); - put(valueMap, "MODEL_INVARIANT_ID", vrNull ? null : o.getVnfResource().getModelInvariantId()); - put(valueMap, "MODEL_VERSION", vrNull ? null : o.getVnfResource().getVersion()); - put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUuid()); - put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); - put(valueMap, "TOSCA_NODE_TYPE", vrNull ? null : o.getVnfResource().getToscaNodeType()); - put(valueMap, "NF_FUNCTION", o.getNfFunction()); - put(valueMap, "NF_TYPE", o.getNfType()); - put(valueMap, "NF_ROLE", o.getNfRole()); - put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); - put(valueMap, "MULTI_STEP_DESIGN", o.getMultiStageDesign()); - - String subitem = new QueryVfModule(vrNull ? null : o.getVfModuleCustomizations()).JSON2(true, true); - valueMap.put("_VFMODULES_", subitem.replaceAll("(?m)^", "\t\t")); - - sb.append(sep).append(this.setTemplate(template, valueMap)); - sep = ",\n"; - } - if (!first) sb.append("\n"); - if (isArray) sb.append("]"); - if (!isEmbed && isArray) sb.append("}"); - return sb.toString(); - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java deleted file mode 100644 index 9215c38706..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.adapters.catalogdb.catalogrest; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.db.catalog.beans.VfModuleCustomization; - -@XmlRootElement(name = "vfModules") -public class QueryVfModule extends CatalogQuery { - private List vfModules; - private final String template = - "\t{\n"+ -// "\t{ \"vfModule\" : { \n"+ - "\t\t\"modelInfo\" : { \n"+ - "\t\t\t\"modelName\" : ,\n"+ - "\t\t\t\"modelUuid\" : ,\n"+ - "\t\t\t\"modelInvariantUuid\" : ,\n"+ - "\t\t\t\"modelVersion\" : ,\n"+ - "\t\t\t\"modelCustomizationUuid\" : \n"+ - "\t\t},"+ - "\t\t\"isBase\" : ,\n"+ - "\t\t\"vfModuleLabel\" : ,\n"+ - "\t\t\"initialCount\" : ,\n"+ - "\t\t\"hasVolumeGroup\" : \n"+ - "\t}"; -// "\t}}"; - - public QueryVfModule() { super(); vfModules = new ArrayList<>(); } - public QueryVfModule(List vlist) { - LOGGER.debug ("QueryVfModule:"); - vfModules = new ArrayList<>(); - if (vlist != null) { - for (VfModuleCustomization o : vlist) { - LOGGER.debug ("-- o is a vfModules ----"); - LOGGER.debug (o.toString()); - vfModules.add(o); - LOGGER.debug ("-------------------"); - } - } - } - - public List getVfModule(){ return this.vfModules; } - public void setVfModule(List v) { this.vfModules = v; } - - @Override - public String toString () { - StringBuilder sb = new StringBuilder(); - - boolean first = true; - int i = 1; - for (VfModuleCustomization o : vfModules) { - sb.append(i).append("\t"); - if (!first) sb.append("\n"); first = false; - sb.append(o); - } - return sb.toString(); - } - - @Override - public String JSON2(boolean isArray, boolean isEmbed) { - StringBuilder sb = new StringBuilder(); - if (!isEmbed && isArray) sb.append("{ "); - if (isArray) sb.append("\"vfModules\": ["); - Map valueMap = new HashMap<>(); - String sep = ""; - boolean first = true; - - for (VfModuleCustomization o : vfModules) { - if (first) sb.append("\n"); first = false; - - boolean vfNull = o.getVfModule() == null ? true : false; - boolean hasVolumeGroup = false; - String envt = o.getHeatEnvironmentArtifactUuid(); - if (envt != null && !"".equals(envt)) { - hasVolumeGroup = true; - } - - put(valueMap, "MODEL_NAME", vfNull ? null : o.getVfModule().getModelName()); - put(valueMap, "MODEL_UUID", vfNull ? null : o.getVfModule().getModelUUID()); - put(valueMap, "MODEL_INVARIANT_ID", vfNull ? null : o.getVfModule().getModelInvariantUuid()); - put(valueMap, "MODEL_VERSION", vfNull ? null : o.getVfModule().getVersion()); - put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUuid()); - put(valueMap, "IS_BASE", vfNull ? false : o.getVfModule().isBase() ? true : false); - put(valueMap, "VF_MODULE_LABEL", o.getLabel()); - put(valueMap, "INITIAL_COUNT", o.getInitialCount()); - put(valueMap, "HAS_VOLUME_GROUP", hasVolumeGroup); - - sb.append(sep).append(this.setTemplate(template, valueMap)); - sep = ",\n"; - } - if (!first) sb.append("\n"); - if (isArray) sb.append("]"); - if (!isEmbed && isArray) sb.append("}"); - return sb.toString(); - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml new file mode 100644 index 0000000000..dbf09a898d --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml @@ -0,0 +1,51 @@ +ssl-enable: false +mso: + site-name: localDevEnv + logPath: logs + catalog: + db: + spring: + endpoint: "http://localhost:8090" + db: + auth: Basic YnBlbDptc28tZGItMTUwNyE= +# H2 +spring: + datasource: + url: jdbc:mariadb://localhost:3306/catalogdb + username: catalog + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + initialize: true + + jpa: + show-sql: true + hibernate: + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + security: + usercredentials: + - + username: bpel + password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO' + role: BPEL-Client + - + username: mso_admin + password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa' + role: ACTUATOR +server: + port: 8090 + tomcat: + max-threads: 50 + + +#Actuator +management: + context-path: /manage + +flyway: + baseline-on-migrate: true + url: jdbc:mariadb://localhost:3306/catalogdb + user: catalog + password: catalog123 diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml new file mode 100644 index 0000000000..94705861f9 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml @@ -0,0 +1,55 @@ +# will be used as entry in DB to say SITE OFF/ON for healthcheck +# MSO Properties go here + +server: + port: 8080 + tomcat: + max-threads: 50 + +mso: + logPath: ./logs/openstack + site-name: localDevEnv + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + +# CatalogDB +spring: + datasource: + url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + driver-class-name: org.mariadb.jdbc.Driver + dbcp2: + initial-size: 5 + max-total: 20 + validation-query: select 1 + test-on-borrow: true + jpa: + show-sql: true + hibernate: + dialect: org.hibernate.dialect.MySQL5Dialect + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + jackson: + serialization: + fail-on-empty-beans: false +flyway: + baseline-on-migrate: false + url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb + user: ${DB_ADMIN_USERNAME} + password: ${DB_ADMIN_PASSWORD} + outOfOrder: true + validateOnMigrate: false + +#Actuator +management: + context-path: /manage + metrics: + se-global-registry: false + export: + prometheus: + enabled: true # Whether exporting of metrics to Prometheus is enabled. + step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1810.1__AddModelAndModelRecipe.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1810.1__AddModelAndModelRecipe.sql new file mode 100644 index 0000000000..0042888117 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1810.1__AddModelAndModelRecipe.sql @@ -0,0 +1,31 @@ +USE catalogdb; + +create table if not exists model_recipe ( + `ID` INT(11) NOT NULL AUTO_INCREMENT, + `MODEL_ID` INT(11), + `ACTION` VARCHAR(40), + `SCHEMA_VERSION` VARCHAR(40), + `DESCRIPTION` VARCHAR(40), + `ORCHESTRATION_URI` VARCHAR(20), + `MODEL_PARAM_XSD` VARCHAR(20), + `RECIPE_TIMEOUT` INT(11), + `CREATION_TIMESTAMP` datetime not null default current_timestamp, + PRIMARY KEY (`ID`), + CONSTRAINT uk1_model_recipe UNIQUE (`MODEL_ID`, `ACTION`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +create table if not exists model ( + `ID` INT(11) NOT NULL AUTO_INCREMENT, + `MODEL_CUSTOMIZATION_ID` VARCHAR(40), + `MODEL_CUSTOMIZATION_NAME` VARCHAR(40), + `MODEL_INVARIANT_ID` VARCHAR(40), + `MODEL_NAME` VARCHAR(40), + `MODEL_TYPE` VARCHAR(20), + `MODEL_VERSION` VARCHAR(20), + `MODEL_VERSION_ID` VARCHAR(40), + `CREATION_TIMESTAMP` datetime not null default current_timestamp, + `RECIPE` INT(11), + PRIMARY KEY (`ID`), + CONSTRAINT uk1_model UNIQUE (`MODEL_TYPE`, `MODEL_VERSION_ID`), + FOREIGN KEY (`RECIPE`) REFERENCES `model_recipe` (`MODEL_ID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1__Base_version.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1__Base_version.sql new file mode 100644 index 0000000000..d603146d73 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1__Base_version.sql @@ -0,0 +1,343 @@ + +USE `catalogdb`; + +CREATE TABLE `allotted_resource` ( + `MODEL_UUID` varchar(200) NOT NULL, + `MODEL_INVARIANT_UUID` varchar(200) NOT NULL, + `MODEL_VERSION` varchar(20) NOT NULL, + `MODEL_NAME` varchar(200) NOT NULL, + `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL, + `SUBCATEGORY` varchar(200) DEFAULT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`MODEL_UUID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `allotted_resource_customization` ( + `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `MODEL_INSTANCE_NAME` varchar(200) NOT NULL, + `PROVIDING_SERVICE_MODEL_UUID` varchar(200) DEFAULT NULL, + `PROVIDING_SERVICE_MODEL_INVARIANT_UUID` varchar(200) DEFAULT NULL, + `PROVIDING_SERVICE_MODEL_NAME` varchar(200) DEFAULT NULL, + `TARGET_NETWORK_ROLE` varchar(200) DEFAULT NULL, + `NF_TYPE` varchar(200) DEFAULT NULL, + `NF_ROLE` varchar(200) DEFAULT NULL, + `NF_FUNCTION` varchar(200) DEFAULT NULL, + `NF_NAMING_CODE` varchar(200) DEFAULT NULL, + `MIN_INSTANCES` int(11) DEFAULT NULL, + `MAX_INSTANCES` int(11) DEFAULT NULL, + `AR_MODEL_UUID` varchar(200) NOT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), + KEY `fk_allotted_resource_customization__allotted_resource1_idx` (`AR_MODEL_UUID`), + CONSTRAINT `fk_allotted_resource_customization__allotted_resource1` FOREIGN KEY (`AR_MODEL_UUID`) REFERENCES `allotted_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `heat_environment` ( + `ARTIFACT_UUID` varchar(200) NOT NULL, + `NAME` varchar(100) NOT NULL, + `VERSION` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `BODY` longtext NOT NULL, + `ARTIFACT_CHECKSUM` varchar(200) NOT NULL DEFAULT 'MANUAL RECORD', + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`ARTIFACT_UUID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `heat_files` ( + `ARTIFACT_UUID` varchar(200) NOT NULL, + `NAME` varchar(200) NOT NULL, + `VERSION` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `BODY` longtext NOT NULL, + `ARTIFACT_CHECKSUM` varchar(200) NOT NULL DEFAULT 'MANUAL RECORD', + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`ARTIFACT_UUID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `heat_template` ( + `ARTIFACT_UUID` varchar(200) NOT NULL, + `NAME` varchar(200) NOT NULL, + `VERSION` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `BODY` longtext NOT NULL, + `TIMEOUT_MINUTES` int(11) DEFAULT NULL, + `ARTIFACT_CHECKSUM` varchar(200) NOT NULL DEFAULT 'MANUAL RECORD', + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`ARTIFACT_UUID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `heat_nested_template` ( + `PARENT_HEAT_TEMPLATE_UUID` varchar(200) NOT NULL, + `CHILD_HEAT_TEMPLATE_UUID` varchar(200) NOT NULL, + `PROVIDER_RESOURCE_FILE` varchar(100) DEFAULT NULL, + PRIMARY KEY (`PARENT_HEAT_TEMPLATE_UUID`,`CHILD_HEAT_TEMPLATE_UUID`), + KEY `fk_heat_nested_template__heat_template2_idx` (`CHILD_HEAT_TEMPLATE_UUID`), + CONSTRAINT `fk_heat_nested_template__child_heat_temp_uuid__heat_template1` FOREIGN KEY (`CHILD_HEAT_TEMPLATE_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_heat_nested_template__parent_heat_temp_uuid__heat_template1` FOREIGN KEY (`PARENT_HEAT_TEMPLATE_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `heat_template_params` ( + `HEAT_TEMPLATE_ARTIFACT_UUID` varchar(200) NOT NULL, + `PARAM_NAME` varchar(100) NOT NULL, + `IS_REQUIRED` bit(1) NOT NULL, + `PARAM_TYPE` varchar(20) DEFAULT NULL, + `PARAM_ALIAS` varchar(45) DEFAULT NULL, + PRIMARY KEY (`HEAT_TEMPLATE_ARTIFACT_UUID`,`PARAM_NAME`), + CONSTRAINT `fk_heat_template_params__heat_template1` FOREIGN KEY (`HEAT_TEMPLATE_ARTIFACT_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `network_recipe` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `MODEL_NAME` varchar(20) NOT NULL, + `ACTION` varchar(50) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `ORCHESTRATION_URI` varchar(256) NOT NULL, + `NETWORK_PARAM_XSD` varchar(2048) DEFAULT NULL, + `RECIPE_TIMEOUT` int(11) DEFAULT NULL, + `SERVICE_TYPE` varchar(45) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `VERSION_STR` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `UK_rl4f296i0p8lyokxveaiwkayi` (`MODEL_NAME`,`ACTION`,`VERSION_STR`) +) ENGINE=InnoDB AUTO_INCREMENT=178 DEFAULT CHARSET=latin1; + +CREATE TABLE `temp_network_heat_template_lookup` ( + `NETWORK_RESOURCE_MODEL_NAME` varchar(200) NOT NULL, + `HEAT_TEMPLATE_ARTIFACT_UUID` varchar(200) NOT NULL, + `AIC_VERSION_MIN` varchar(20) NOT NULL, + `AIC_VERSION_MAX` varchar(20) DEFAULT NULL, + PRIMARY KEY (`NETWORK_RESOURCE_MODEL_NAME`), + KEY `fk_temp_network_heat_template_lookup__heat_template1_idx` (`HEAT_TEMPLATE_ARTIFACT_UUID`), + CONSTRAINT `fk_temp_network_heat_template_lookup__heat_template1` FOREIGN KEY (`HEAT_TEMPLATE_ARTIFACT_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE NO ACTION ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `network_resource` ( + `MODEL_UUID` varchar(200) NOT NULL, + `MODEL_NAME` varchar(200) NOT NULL, + `MODEL_INVARIANT_UUID` varchar(200) DEFAULT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `HEAT_TEMPLATE_ARTIFACT_UUID` varchar(200) NOT NULL, + `NEUTRON_NETWORK_TYPE` varchar(20) DEFAULT NULL, + `MODEL_VERSION` varchar(20) DEFAULT NULL, + `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL, + `AIC_VERSION_MIN` varchar(20) NOT NULL, + `AIC_VERSION_MAX` varchar(20) DEFAULT NULL, + `ORCHESTRATION_MODE` varchar(20) DEFAULT 'HEAT', + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`MODEL_UUID`), + KEY `fk_network_resource__temp_network_heat_template_lookup1_idx` (`MODEL_NAME`), + KEY `fk_network_resource__heat_template1_idx` (`HEAT_TEMPLATE_ARTIFACT_UUID`), + CONSTRAINT `fk_network_resource__heat_template1` FOREIGN KEY (`HEAT_TEMPLATE_ARTIFACT_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE NO ACTION ON UPDATE CASCADE, + CONSTRAINT `fk_network_resource__temp_network_heat_template_lookup__mod_nm1` FOREIGN KEY (`MODEL_NAME`) REFERENCES `temp_network_heat_template_lookup` (`NETWORK_RESOURCE_MODEL_NAME`) ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `network_resource_customization` ( + `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `MODEL_INSTANCE_NAME` varchar(200) NOT NULL, + `NETWORK_TECHNOLOGY` varchar(45) DEFAULT NULL, + `NETWORK_TYPE` varchar(45) DEFAULT NULL, + `NETWORK_ROLE` varchar(200) DEFAULT NULL, + `NETWORK_SCOPE` varchar(45) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `NETWORK_RESOURCE_MODEL_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), + KEY `fk_network_resource_customization__network_resource1_idx` (`NETWORK_RESOURCE_MODEL_UUID`), + CONSTRAINT `fk_network_resource_customization__network_resource1` FOREIGN KEY (`NETWORK_RESOURCE_MODEL_UUID`) REFERENCES `network_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `tosca_csar` ( + `ARTIFACT_UUID` varchar(200) NOT NULL, + `NAME` varchar(200) NOT NULL, + `VERSION` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `ARTIFACT_CHECKSUM` varchar(200) NOT NULL, + `URL` varchar(200) NOT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`ARTIFACT_UUID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `service` ( + `MODEL_UUID` varchar(200) NOT NULL, + `MODEL_NAME` varchar(200) NOT NULL, + `MODEL_INVARIANT_UUID` varchar(200) NOT NULL, + `MODEL_VERSION` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `TOSCA_CSAR_ARTIFACT_UUID` varchar(200) DEFAULT NULL, + `SERVICE_TYPE` varchar(200) DEFAULT NULL, + `SERVICE_ROLE` varchar(200) DEFAULT NULL, + `ENVIRONMENT_CONTEXT` varchar(200) DEFAULT NULL, + `WORKLOAD_CONTEXT` varchar(200) DEFAULT NULL, + PRIMARY KEY (`MODEL_UUID`), + KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`), + CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `service_recipe` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ACTION` varchar(50) NOT NULL, + `VERSION_STR` varchar(20) DEFAULT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `ORCHESTRATION_URI` varchar(256) NOT NULL, + `SERVICE_PARAM_XSD` varchar(2048) DEFAULT NULL, + `RECIPE_TIMEOUT` int(11) DEFAULT NULL, + `SERVICE_TIMEOUT_INTERIM` int(11) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `UK_7fav5dkux2v8g9d2i5ymudlgc` (`SERVICE_MODEL_UUID`,`ACTION`), + KEY `fk_service_recipe__service1_idx` (`SERVICE_MODEL_UUID`), + CONSTRAINT `fk_service_recipe__service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=latin1; + +CREATE TABLE `service_to_resource_customizations` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `MODEL_TYPE` varchar(20) NOT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`,`MODEL_TYPE`), + KEY `fk_service_to_resource_cust__service_model_uuid_idx` (`SERVICE_MODEL_UUID`), + KEY `fk_service_to_resource_cust__resource_model_customiz_uuid_idx` (`RESOURCE_MODEL_CUSTOMIZATION_UUID`), + CONSTRAINT `fk_service_to_resource_cust__service__model_uuid0` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `vnf_components` ( + `VNF_ID` int(11) NOT NULL, + `COMPONENT_TYPE` varchar(20) NOT NULL, + `HEAT_TEMPLATE_ID` int(11) DEFAULT NULL, + `HEAT_ENVIRONMENT_ID` int(11) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`VNF_ID`,`COMPONENT_TYPE`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `vnf_components_recipe` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `VNF_TYPE` varchar(200) DEFAULT NULL, + `VNF_COMPONENT_TYPE` varchar(45) NOT NULL, + `ACTION` varchar(50) NOT NULL, + `SERVICE_TYPE` varchar(45) DEFAULT NULL, + `VERSION` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `ORCHESTRATION_URI` varchar(256) NOT NULL, + `VNF_COMPONENT_PARAM_XSD` varchar(2048) DEFAULT NULL, + `RECIPE_TIMEOUT` int(11) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime DEFAULT CURRENT_TIMESTAMP, + `VF_MODULE_MODEL_UUID` varchar(200) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `UK_4dpdwddaaclhc11wxsb7h59ma` (`VF_MODULE_MODEL_UUID`,`VNF_COMPONENT_TYPE`,`ACTION`,`VERSION`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1; + +CREATE TABLE `vnf_recipe` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `VNF_TYPE` varchar(200) DEFAULT NULL, + `ACTION` varchar(50) NOT NULL, + `SERVICE_TYPE` varchar(45) DEFAULT NULL, + `VERSION_STR` varchar(20) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `ORCHESTRATION_URI` varchar(256) NOT NULL, + `VNF_PARAM_XSD` varchar(2048) DEFAULT NULL, + `RECIPE_TIMEOUT` int(11) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime DEFAULT CURRENT_TIMESTAMP, + `VF_MODULE_ID` varchar(100) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `UK_f3tvqau498vrifq3cr8qnigkr` (`VF_MODULE_ID`,`ACTION`,`VERSION_STR`) +) ENGINE=InnoDB AUTO_INCREMENT=10006 DEFAULT CHARSET=latin1; + +CREATE TABLE `vnf_resource` ( + `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT', + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `MODEL_UUID` varchar(200) NOT NULL, + `AIC_VERSION_MIN` varchar(20) DEFAULT NULL, + `AIC_VERSION_MAX` varchar(20) DEFAULT NULL, + `MODEL_INVARIANT_UUID` varchar(200) DEFAULT NULL, + `MODEL_VERSION` varchar(20) NOT NULL, + `MODEL_NAME` varchar(200) DEFAULT NULL, + `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL, + `HEAT_TEMPLATE_ARTIFACT_UUID` varchar(200) DEFAULT NULL, + PRIMARY KEY (`MODEL_UUID`), + KEY `fk_vnf_resource__heat_template1` (`HEAT_TEMPLATE_ARTIFACT_UUID`), + CONSTRAINT `fk_vnf_resource__heat_template1` FOREIGN KEY (`HEAT_TEMPLATE_ARTIFACT_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `vnf_resource_customization` ( + `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `MODEL_INSTANCE_NAME` varchar(200) NOT NULL, + `MIN_INSTANCES` int(11) DEFAULT NULL, + `MAX_INSTANCES` int(11) DEFAULT NULL, + `AVAILABILITY_ZONE_MAX_COUNT` int(11) DEFAULT NULL, + `NF_TYPE` varchar(200) DEFAULT NULL, + `NF_ROLE` varchar(200) DEFAULT NULL, + `NF_FUNCTION` varchar(200) DEFAULT NULL, + `NF_NAMING_CODE` varchar(200) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL, + `MULTI_STAGE_DESIGN` varchar(20) DEFAULT NULL, + PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), + KEY `fk_vnf_resource_customization__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`), + CONSTRAINT `fk_vnf_resource_customization__vnf_resource1` FOREIGN KEY (`VNF_RESOURCE_MODEL_UUID`) REFERENCES `vnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +CREATE TABLE `vf_module` ( + `MODEL_UUID` varchar(200) NOT NULL, + `MODEL_INVARIANT_UUID` varchar(200) DEFAULT NULL, + `MODEL_VERSION` varchar(20) NOT NULL, + `MODEL_NAME` varchar(200) NOT NULL, + `DESCRIPTION` varchar(1200) DEFAULT NULL, + `IS_BASE` int(11) NOT NULL, + `HEAT_TEMPLATE_ARTIFACT_UUID` varchar(200) DEFAULT NULL, + `VOL_HEAT_TEMPLATE_ARTIFACT_UUID` varchar(200) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`MODEL_UUID`,`VNF_RESOURCE_MODEL_UUID`), + KEY `fk_vf_module__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`), + KEY `fk_vf_module__heat_template_art_uuid__heat_template1_idx` (`HEAT_TEMPLATE_ARTIFACT_UUID`), + KEY `fk_vf_module__vol_heat_template_art_uuid__heat_template2_idx` (`VOL_HEAT_TEMPLATE_ARTIFACT_UUID`), + CONSTRAINT `fk_vf_module__heat_template_art_uuid__heat_template1` FOREIGN KEY (`HEAT_TEMPLATE_ARTIFACT_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_vf_module__vnf_resource1` FOREIGN KEY (`VNF_RESOURCE_MODEL_UUID`) REFERENCES `vnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_vf_module__vol_heat_template_art_uuid__heat_template2` FOREIGN KEY (`VOL_HEAT_TEMPLATE_ARTIFACT_UUID`) REFERENCES `heat_template` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `vf_module_customization` ( + `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `LABEL` varchar(200) DEFAULT NULL, + `INITIAL_COUNT` int(11) DEFAULT '0', + `MIN_INSTANCES` int(11) DEFAULT '0', + `MAX_INSTANCES` int(11) DEFAULT NULL, + `AVAILABILITY_ZONE_COUNT` int(11) DEFAULT NULL, + `HEAT_ENVIRONMENT_ARTIFACT_UUID` varchar(200) DEFAULT NULL, + `VOL_ENVIRONMENT_ARTIFACT_UUID` varchar(200) DEFAULT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `VF_MODULE_MODEL_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), + KEY `fk_vf_module_customization__vf_module1_idx` (`VF_MODULE_MODEL_UUID`), + KEY `fk_vf_module_customization__heat_env__heat_environment1_idx` (`HEAT_ENVIRONMENT_ARTIFACT_UUID`), + KEY `fk_vf_module_customization__vol_env__heat_environment2_idx` (`VOL_ENVIRONMENT_ARTIFACT_UUID`), + CONSTRAINT `fk_vf_module_customization__heat_env__heat_environment1` FOREIGN KEY (`HEAT_ENVIRONMENT_ARTIFACT_UUID`) REFERENCES `heat_environment` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_vf_module_customization__vf_module1` FOREIGN KEY (`VF_MODULE_MODEL_UUID`) REFERENCES `vf_module` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_vf_module_customization__vol_env__heat_environment2` FOREIGN KEY (`VOL_ENVIRONMENT_ARTIFACT_UUID`) REFERENCES `heat_environment` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `vf_module_to_heat_files` ( + `VF_MODULE_MODEL_UUID` varchar(200) NOT NULL, + `HEAT_FILES_ARTIFACT_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`VF_MODULE_MODEL_UUID`,`HEAT_FILES_ARTIFACT_UUID`), + KEY `fk_vf_module_to_heat_files__heat_files__artifact_uuid1_idx` (`HEAT_FILES_ARTIFACT_UUID`), + CONSTRAINT `fk_vf_module_to_heat_files__heat_files__artifact_uuid1` FOREIGN KEY (`HEAT_FILES_ARTIFACT_UUID`) REFERENCES `heat_files` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_vf_module_to_heat_files__vf_module__model_uuid1` FOREIGN KEY (`VF_MODULE_MODEL_UUID`) REFERENCES `vf_module` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='il fait ce qu''il dit'; + + +CREATE TABLE `vnf_res_custom_to_vf_module_custom` ( + `VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID`,`VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID`), + KEY `fk_vnf_res_custom_to_vf_module_custom__vf_module_customizat_idx` (`VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID`), + CONSTRAINT `fk_vnf_res_custom_to_vf_module_custom__vf_module_customization1` FOREIGN KEY (`VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID`) REFERENCES `vf_module_customization` (`MODEL_CUSTOMIZATION_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_vnf_res_custom_to_vf_module_custom__vnf_resource_customiza1` FOREIGN KEY (`VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID`) REFERENCES `vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.0__Modify_Resource_Relationships.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.0__Modify_Resource_Relationships.sql new file mode 100644 index 0000000000..b141784e8d --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.0__Modify_Resource_Relationships.sql @@ -0,0 +1,247 @@ + +USE catalogdb; + +DELETE from service where model_uuid in ( SELECT SERVICE_MODEL_UUID +FROM service_to_resource_customizations +GROUP BY +SERVICE_MODEL_UUID, resource_model_customization_uuid +HAVING COUNT(*) > 1); + + +CREATE TABLE IF NOT EXISTS external_service_to_internal_model_mapping ( +id INT(11) NOT NULL, +SERVICE_NAME VARCHAR(200) NOT NULL, +PRODUCT_FLAVOR VARCHAR(200) NULL, +SUBSCRIPTION_SERVICE_TYPE VARCHAR(200) NOT NULL, +SERVICE_MODEL_UUID VARCHAR(200) NOT NULL, +PRIMARY KEY (id), +UNIQUE INDEX UK_external_service_to_internal_model_mapping +(SERVICE_NAME ASC, PRODUCT_FLAVOR ASC, SERVICE_MODEL_UUID ASC)); + +CREATE TABLE IF NOT EXISTS `collection_resource` ( + MODEL_UUID varchar(200) NOT NULL, + MODEL_NAME varchar(200) NOT NULL, + MODEL_INVARIANT_UUID varchar(200) NOT NULL, + MODEL_VERSION varchar(20) NOT NULL, + TOSCA_NODE_TYPE varchar(200) NOT NULL, + DESCRIPTION varchar(200), + CREATION_TIMESTAMP datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`MODEL_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE IF NOT EXISTS `collection_resource_customization` ( + MODEL_CUSTOMIZATION_UUID varchar(200) NOT NULL, + MODEL_INSTANCE_NAME varchar(200) NOT NULL, + ROLE varchar(200) NOT NULL, + PRIMARY_TYPE varchar(200) NOT NULL, + FUNCTION varchar(200) NOT NULL, + SUBINTERFACE_NETWORK_QUANTITY INT, + COLLECTION_RESOURCE_TYPE varchar(200) NOT NULL, + CREATION_TIMESTAMP datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + CR_MODEL_UUID varchar(200) NOT NULL, + PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE IF NOT EXISTS `instance_group` ( + MODEL_UUID varchar(200) NOT NULL, + MODEL_NAME varchar(200) NOT NULL, + MODEL_INVARIANT_UUID varchar(200) NOT NULL, + MODEL_VERSION varchar(20) NOT NULL, + TOSCA_NODE_TYPE varchar(200) DEFAULT NULL, + ROLE varchar(200) NOT NULL, + PRIMARY_TYPE varchar(200) NOT NULL, + FUNCTION varchar(200) NOT NULL, + DESCRIPTION varchar(200), + CREATION_TIMESTAMP datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + CR_MODEL_UUID varchar(200) NOT NULL, + INSTANCE_GROUP_TYPE varchar(200) NOT NULL, + PRIMARY KEY (`MODEL_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + + CREATE TABLE IF NOT EXISTS `catalogdb`.`configuration` + ( `MODEL_UUID` VARCHAR(200) NOT NULL, + `MODEL_INVARIANT_UUID` VARCHAR(200) NOT NULL, + `MODEL_VERSION` VARCHAR(20) NOT NULL, + `MODEL_NAME` VARCHAR(200) NOT NULL, + `TOSCA_NODE_TYPE` VARCHAR(200) NOT NULL, + `DESCRIPTION` VARCHAR(1200) NULL, + `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`MODEL_UUID`)) + ENGINE = InnoDB AUTO_INCREMENT = 20654 + DEFAULT CHARACTER SET = latin1; + + CREATE TABLE IF NOT EXISTS `catalogdb`.`service_proxy` ( + `MODEL_UUID` VARCHAR(200) NOT NULL, + `MODEL_INVARIANT_UUID` VARCHAR(200) NOT NULL, + `MODEL_VERSION` VARCHAR(20) NOT NULL, + `MODEL_NAME` VARCHAR(200) NOT NULL, + `DESCRIPTION` VARCHAR(1200) NULL, + `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`MODEL_UUID`)) + ENGINE = InnoDB AUTO_INCREMENT = 20654 + DEFAULT CHARACTER SET = latin1; + +CREATE TABLE IF NOT EXISTS `service_proxy_customization` ( +`MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL, +`MODEL_INSTANCE_NAME` VARCHAR(200) NOT NULL, +`TOSCA_NODE_TYPE` VARCHAR(200) NOT NULL, +`SOURCE_SERVICE_MODEL_UUID` VARCHAR(200) NOT NULL, +`CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, +`SERVICE_PROXY_MODEL_UUID` VARCHAR(200) NOT NULL, +PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), +INDEX `fk_service_proxy_customization__service_proxy1_idx` (`SERVICE_PROXY_MODEL_UUID` ASC), +INDEX `fk_service_proxy_customization__service1_idx` (`SOURCE_SERVICE_MODEL_UUID` ASC), +CONSTRAINT`fk_spr_customization__service_proxy_resource1` +FOREIGN KEY (`SERVICE_PROXY_MODEL_UUID`) REFERENCES `catalogdb`.`service_proxy` (`MODEL_UUID`) +ON DELETE CASCADE ON UPDATE CASCADE, +CONSTRAINT `fk_service_proxy_resource_customization__service1` +FOREIGN KEY (`SOURCE_SERVICE_MODEL_UUID`) REFERENCES `catalogdb`.`service` +(`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE) +ENGINE = InnoDB +AUTO_INCREMENT = 20654 +DEFAULT CHARACTER SET = latin1; + +CREATE TABLE IF NOT EXISTS `catalogdb`.`configuration_customization` ( +`MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL, +`MODEL_INSTANCE_NAME` VARCHAR(200) NOT NULL, +`CONFIGURATION_TYPE` VARCHAR(200) NULL, +`CONFIGURATION_ROLE` VARCHAR(200) NULL, +`CONFIGURATION_FUNCTION` VARCHAR(200) NULL, +`CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, +`CONFIGURATION_MODEL_UUID` VARCHAR(200) NOT NULL, +`SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NULL, +`CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NULL, +PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), +INDEX `fk_configuration_customization__configuration_idx` (`CONFIGURATION_MODEL_UUID` ASC), +INDEX `fk_configuration_customization__service_proxy_customization_idx` +(`SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` ASC), +INDEX `fk_configuration_customization__configuration_customization_idx` +(`CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` ASC), +CONSTRAINT `fk_configuration_resource_customization__configuration_resour1` +FOREIGN KEY (`CONFIGURATION_MODEL_UUID`) REFERENCES `catalogdb`.`configuration` (`MODEL_UUID`) +ON DELETE CASCADE ON UPDATE CASCADE, +CONSTRAINT `fk_configuration_customization__service_proxy_customization1` FOREIGN +KEY (`SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID`) REFERENCES +`catalogdb`.`service_proxy_customization` (`MODEL_CUSTOMIZATION_UUID`) +ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT +`fk_configuration_customization__configuration_customization1` FOREIGN +KEY (`CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID`) REFERENCES +`catalogdb`.`configuration_customization` (`MODEL_CUSTOMIZATION_UUID`) +ON DELETE CASCADE ON UPDATE CASCADE) +ENGINE = InnoDB +AUTO_INCREMENT =20654 +DEFAULT CHARACTER SET = latin1; + + +CREATE TABLE `service_proxy_customization_to_service` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +CREATE TABLE `configuration_customization_to_service` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +CREATE TABLE IF NOT EXISTS `collection_resource_customization_to_service` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +CREATE TABLE `network_resource_customization_to_service` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `vnf_resource_customization_to_service` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `allotted_resource_customization_to_service` ( + `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL, + PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + + + + +CREATE TABLE IF NOT EXISTS `collection_network_resource_customization` ( +`MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL, +`MODEL_INSTANCE_NAME` VARCHAR(200) NOT NULL, +`NETWORK_TECHNOLOGY` VARCHAR(45) NULL, +`NETWORK_TYPE` VARCHAR(45) NULL, +`NETWORK_ROLE` VARCHAR(200) NULL, +`NETWORK_SCOPE` VARCHAR(45) NULL, +`CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, +`NETWORK_RESOURCE_MODEL_UUID` VARCHAR(200) NOT NULL, `INSTANCE_GROUP_MODEL_UUID` VARCHAR(200) NULL, +`CRC_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL, PRIMARY KEY +(`MODEL_CUSTOMIZATION_UUID`, `CRC_MODEL_CUSTOMIZATION_UUID`), +INDEX `fk_collection_net_resource_customization__network_resource1_idx` +(`NETWORK_RESOURCE_MODEL_UUID` ASC), INDEX +`fk_collection_net_resource_customization__instance_group1_idx` +(`INSTANCE_GROUP_MODEL_UUID` ASC), INDEX +`fk_col_net_res_customization__collection_res_customization_idx` +(`CRC_MODEL_CUSTOMIZATION_UUID` ASC), CONSTRAINT +`fk_collection_net_resource_customization__network_resource10` FOREIGN +KEY (`NETWORK_RESOURCE_MODEL_UUID`) REFERENCES +`catalogdb`.`network_resource` (`MODEL_UUID`) ON DELETE CASCADE ON +UPDATE CASCADE, CONSTRAINT +`fk_collection_net_resource_customization__instance_group10` FOREIGN KEY +(`INSTANCE_GROUP_MODEL_UUID`) REFERENCES `instance_group` +(`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT +`fk_collection_network_resource_customization__collection_reso1` FOREIGN +KEY (`CRC_MODEL_CUSTOMIZATION_UUID`) REFERENCES +`collection_resource_customization` +(`MODEL_CUSTOMIZATION_UUID`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE += InnoDB DEFAULT CHARACTER SET = latin1; + + +CREATE TABLE IF NOT EXISTS `northbound_request_ref_lookup` ( +`id` INT(11) NOT NULL AUTO_INCREMENT, +`REQUEST_SCOPE` VARCHAR(200) NOT NULL, +`MACRO_ACTION` VARCHAR(200) NOT NULL, +`ACTION` VARCHAR(200) NOT NULL, +`IS_ALACARTE` TINYINT(1) NOT NULL DEFAULT 0, +`MIN_API_VERSION` DOUBLE NOT NULL, +`MAX_API_VERSION` DOUBLE NULL, +PRIMARY KEY (`id`), +UNIQUE INDEX `UK_northbound_request_ref_lookup` (`MIN_API_VERSION` ASC, `REQUEST_SCOPE` ASC, `ACTION` ASC, `IS_ALACARTE` ASC, `MACRO_ACTION` ASC)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = latin1; + +CREATE TABLE IF NOT EXISTS `orchestration_flow_reference` ( +`id` INT(11) NOT NULL AUTO_INCREMENT, +`COMPOSITE_ACTION` VARCHAR(200) NOT NULL, +`SEQ_NO` INT(11) NOT NULL, +`FLOW_NAME` VARCHAR(200) NOT NULL, +`FLOW_VERSION` DOUBLE NOT NULL, +`NB_REQ_REF_LOOKUP_ID` INT(11) NOT NULL, +PRIMARY KEY (`id`), +INDEX `fk_orchestration_flow_reference__northbound_req_ref_look_idx` (`NB_REQ_REF_LOOKUP_ID` ASC), +UNIQUE INDEX `UK_orchestration_flow_reference` (`COMPOSITE_ACTION` ASC, `FLOW_NAME` ASC, `SEQ_NO` ASC, `NB_REQ_REF_LOOKUP_ID` ASC), +CONSTRAINT `fk_orchestration_flow_reference__northbound_request_ref_look1` +FOREIGN KEY (`NB_REQ_REF_LOOKUP_ID`) REFERENCES `northbound_request_ref_lookup` (`id`) +ON DELETE CASCADE ON UPDATE CASCADE) +ENGINE = InnoDB DEFAULT CHARACTER SET = latin1; + +CREATE TABLE IF NOT EXISTS `rainy_day_handler_macro` ( +`id` INT(11) NOT NULL AUTO_INCREMENT, +`FLOW_NAME` VARCHAR(200) NOT NULL, +`SERVICE_TYPE` VARCHAR(200) NOT NULL, +`VNF_TYPE` VARCHAR(200) NOT NULL, +`ERROR_CODE` VARCHAR(200) NOT NULL, +`WORK_STEP` VARCHAR(200) NOT NULL, +`POLICY` VARCHAR(200) NOT NULL, +PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = latin1; diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.1__Modify_Resource_Relationships_Alters.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.1__Modify_Resource_Relationships_Alters.sql new file mode 100644 index 0000000000..92b5c9b65f --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.0.1__Modify_Resource_Relationships_Alters.sql @@ -0,0 +1,208 @@ + +USE catalogdb; +ALTER TABLE collection_resource_customization +ADD FOREIGN KEY ( CR_MODEL_UUID) +REFERENCES collection_resource(MODEL_UUID) +ON DELETE CASCADE; + +ALTER TABLE vnf_resource_customization +ADD COLUMN +INSTANCE_GROUP_MODEL_UUID varchar(200); + + +ALTER TABLE instance_group +ADD FOREIGN KEY ( CR_MODEL_UUID) +REFERENCES collection_resource(MODEL_UUID) +ON DELETE CASCADE; + + +ALTER TABLE collection_resource_customization_to_service +ADD FOREIGN KEY (service_model_uuid) +REFERENCES service(MODEL_UUID) +ON DELETE CASCADE; + +ALTER TABLE allotted_resource_customization_to_service +ADD FOREIGN KEY (service_model_uuid) +REFERENCES service(MODEL_UUID) +ON DELETE CASCADE; + + +ALTER TABLE vnf_resource_customization_to_service +ADD FOREIGN KEY (service_model_uuid) +REFERENCES service(MODEL_UUID) +ON DELETE CASCADE; + + +ALTER TABLE network_resource_customization_to_service +ADD FOREIGN KEY (service_model_uuid) +REFERENCES service(MODEL_UUID) +ON DELETE CASCADE; + + +ALTER TABLE network_resource_customization_to_service +ADD FOREIGN KEY (resource_model_customization_uuid) +REFERENCES network_resource_customization(model_customization_uuid) +ON DELETE CASCADE; + +ALTER TABLE vnf_resource_customization_to_service +ADD FOREIGN KEY (resource_model_customization_uuid) +REFERENCES vnf_resource_customization(model_customization_uuid) +ON DELETE CASCADE; + +ALTER TABLE allotted_resource_customization_to_service +ADD FOREIGN KEY (resource_model_customization_uuid) +REFERENCES allotted_resource_customization(model_customization_uuid) +ON DELETE CASCADE; + +ALTER TABLE collection_resource_customization_to_service +ADD FOREIGN KEY (resource_model_customization_uuid) +REFERENCES collection_resource_customization(model_customization_uuid) +ON DELETE CASCADE; + +INSERT INTO network_resource_customization_to_service SELECT service_model_uuid,resource_model_customization_uuid +FROM service_to_resource_customizations WHERE model_type = 'network' and service_model_uuid in(select model_uuid from service) +AND resource_model_customization_uuid in ( SELECT MODEL_CUSTOMIZATION_UUID from network_resource_customization); + +INSERT INTO allotted_resource_customization_to_service SELECT service_model_uuid,resource_model_customization_uuid +FROM service_to_resource_customizations WHERE model_type = 'allottedResource' and service_model_uuid in(select model_uuid from service) +AND resource_model_customization_uuid in ( SELECT MODEL_CUSTOMIZATION_UUID from allotted_resource_customization); + +INSERT INTO vnf_resource_customization_to_service SELECT service_model_uuid,resource_model_customization_uuid +FROM service_to_resource_customizations WHERE model_type = 'vnf' and service_model_uuid in(select model_uuid from service) +AND resource_model_customization_uuid in ( SELECT MODEL_CUSTOMIZATION_UUID from vnf_resource_customization); + +DROP TABLE service_to_resource_customizations; + + +INSERT INTO vnf_recipe (VNF_TYPE, ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) +VALUES +('GR-API-DEFAULT', 'createInstance', '1', 'Gr api recipe to create vnf', '/mso/async/services/WorkflowActionBB', 180), +('GR-API-DEFAULT', 'deleteInstance', '1', 'Gr api recipe to delete vnf', '/mso/async/services/WorkflowActionBB', 180), +('GR-API-DEFAULT', 'updateInstance', '1', 'Gr api recipe to update vnf', '/mso/async/services/WorkflowActionBB', 180), +('GR-API-DEFAULT', 'replaceInstance', '1', 'Gr api recipe to replace vnf', '/mso/async/services/WorkflowActionBB', 180), +('GR-API-DEFAULT', 'inPlaceSoftwareUpdate', '1', 'Gr api recipe to do an in place software update', '/mso/async/services/WorkflowActionBB', 180), +('GR-API-DEFAULT', 'applyUpdatedConfig', '1', 'Gr api recipe to apply updated config', '/mso/async/services/WorkflowActionBB', 180); + +UPDATE vnf_recipe +SET vnf_type = 'VNF-API-DEFAULT' +WHERE vnf_type = 'VID_DEFAULT'; + +UPDATE vnf_recipe +SET description = 'Vnf api recipe to create vnf' +WHERE description = 'VID_DEFAULT recipe to create VNF if no custom BPMN flow is found'; + +UPDATE vnf_recipe +SET description = 'Vnf api recipe to delete vnf' +WHERE description = 'VID_DEFAULT recipe to delete VNF if no custom BPMN flow is found'; + +UPDATE vnf_recipe +SET description = 'Vnf api recipe to update vnf' +WHERE description = 'VID_DEFAULT update'; + +UPDATE vnf_recipe +SET description = 'Vnf api recipe to replace vnf' +WHERE description = 'VID_DEFAULT replace'; + +UPDATE vnf_recipe +SET description = 'Vnf api recipe to do an in place software update' +WHERE description = 'VID_DEFAULT inPlaceSoftwareUpdate'; + +UPDATE vnf_recipe +SET description = 'Vnf api recipe to apply updated config' +WHERE description = 'VID_DEFAULT applyUpdatedConfig'; + +INSERT INTO service (MODEL_UUID, MODEL_NAME, MODEL_INVARIANT_UUID, MODEL_VERSION, DESCRIPTION) +VALUES +('DummyGRApiDefaultModelUUID?', 'GR-API-DEFAULT', 'DummyGRApiDefaultModelInvariantUUID?', '1.0', 'Gr api service for VID to use for infra APIH orchestration'); + +UPDATE service +SET model_name = 'VNF-API-DEFAULT', + description = 'Vnf api service for VID to use for infra APIH orchestration' +WHERE model_name = 'VID_DEFAULT'; + +INSERT INTO service_recipe (ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, SERVICE_MODEL_UUID) +VALUES +('activateInstance', '1.0', 'Gr api recipe to activate service-instance', '/mso/async/services/WorkflowActionBB', 180, 'DummyGRApiDefaultModelUUID?'), +('createInstance', '1.0', 'Gr api recipe to create service-instance', '/mso/async/services/WorkflowActionBB', 180, 'DummyGRApiDefaultModelUUID?'), +('deactivateInstance', '1.0', 'Gr api recipe to deactivate service-instance', '/mso/async/services/WorkflowActionBB', 180, 'DummyGRApiDefaultModelUUID?'), +('deleteInstance', '1.0', 'Gr api recipe to delete service-instance', '/mso/async/services/WorkflowActionBB', 180, 'DummyGRApiDefaultModelUUID?'); + +UPDATE service_recipe +SET description = 'Vnf api recipe to activate service-instance' +WHERE description = 'VID_DEFAULT activate'; + +UPDATE service_recipe +SET description = 'Vnf api recipe to create service-instance' +WHERE description = 'VID_DEFAULT recipe to create service-instance if no custom BPMN flow is found'; + +UPDATE service_recipe +SET description = 'Vnf api recipe to deactivate service-instance' +WHERE description = 'VID_DEFAULT deactivate'; + +UPDATE service_recipe +SET description = 'Vnf api recipe to delete service-instance' +WHERE description = 'VID_DEFAULT recipe to delete service-instance if no custom BPMN flow is found'; + +INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_MODEL_UUID) +VALUES +('volumeGroup', 'createInstance', '1', 'Gr api recipe to create volume-group', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'), +('volumeGroup', 'deleteInstance', '1', 'Gr api recipe to delete volume-group', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'), +('volumeGroup', 'updateInstance', '1', 'Gr api recipe to update volume-group', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'), +('vfModule', 'createInstance', '1', 'Gr api recipe to create vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'), +('vfModule', 'deleteInstance', '1', 'Gr api recipe to delete vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'), +('vfModule', 'updateInstance', '1', 'Gr api recipe to update vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'), +('vfModule', 'replaceInstance', '1', 'Gr api recipe to replace vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'); + +UPDATE vnf_components_recipe +SET vf_module_model_uuid = 'VNF-API-DEFAULT' +WHERE vf_module_model_uuid = 'VID_DEFAULT'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to create volume-group' +WHERE description = 'VID_DEFAULT recipe to create volume-group if no custom BPMN flow is found'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to delete volume-group' +WHERE description = 'VID_DEFAULT recipe to delete volume-group if no custom BPMN flow is found'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to update volume-group' +WHERE description = 'VID_DEFAULT recipe to update volume-group if no custom BPMN flow is found'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to create vf-module' +WHERE description = 'VID_DEFAULT recipe to create vf-module if no custom BPMN flow is found'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to delete vf-module' +WHERE description = 'VID_DEFAULT recipe to delete vf-module if no custom BPMN flow is found'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to update vf-module' +WHERE description = 'VID_DEFAULT recipe to update vf-module if no custom BPMN flow is found'; + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to replace vf-module' +WHERE description = 'VID_DEFAULT vfModule replace'; + +INSERT INTO network_recipe (MODEL_NAME, ACTION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VERSION_STR) +VALUES +('GR-API-DEFAULT', 'createInstance', 'Gr api recipe to create network', '/mso/async/services/WorkflowActionBB', 180, '1.0'), +('GR-API-DEFAULT', 'updateInstance', 'Gr api recipe to update network', '/mso/async/services/WorkflowActionBB', 180, '1.0'), +('GR-API-DEFAULT', 'deleteInstance', 'Gr api recipe to delete network', '/mso/async/services/WorkflowActionBB', 180, '1.0'); + +UPDATE network_recipe +SET model_name = 'VNF-API-DEFAULT' +WHERE model_name = 'VID_DEFAULT'; + +UPDATE network_recipe +SET description = 'Vnf api recipe to create network' +WHERE description = 'VID_DEFAULT recipe to create network if no custom BPMN flow is found'; + +UPDATE network_recipe +SET description = 'Vnf api recipe to update network' +WHERE description = 'VID_DEFAULT recipe to update network if no custom BPMN flow is found'; + +UPDATE network_recipe +SET description = 'Vnf api recipe to delete network' +WHERE description = 'VID_DEFAULT recipe to delete network if no custom BPMN flow is found'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.10__VNFCInstanceGroupChanges.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.10__VNFCInstanceGroupChanges.sql new file mode 100644 index 0000000000..ea7098724f --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.10__VNFCInstanceGroupChanges.sql @@ -0,0 +1,7 @@ +USE catalogdb; + +ALTER TABLE + `instance_group` CHANGE COLUMN `CR_MODEL_UUID` `CR_MODEL_UUID` VARCHAR(200) NULL, + CHANGE COLUMN `tosca_node_type` `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL, + CHANGE COLUMN `object_type` `OBJECT_TYPE` varchar(200) NOT NULL; + \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.11__Modify_IS_Base_Type.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.11__Modify_IS_Base_Type.sql new file mode 100644 index 0000000000..8e11121dd1 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.11__Modify_IS_Base_Type.sql @@ -0,0 +1,4 @@ +USE catalogdb; + +ALTER TABLE + `vf_module` CHANGE COLUMN `IS_BASE` `IS_BASE` TINYINT(1) NOT NULL; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.12__UpdateMacroReferenceData_Homing.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.12__UpdateMacroReferenceData_Homing.sql new file mode 100644 index 0000000000..442034ca98 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.12__UpdateMacroReferenceData_Homing.sql @@ -0,0 +1,4 @@ + +USE catalogdb; + +UPDATE orchestration_flow_reference SET FLOW_NAME = 'HomingV2' WHERE FLOW_NAME = 'SniroHoming'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.13__Alter_external_service_to_internal_model_mapping.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.13__Alter_external_service_to_internal_model_mapping.sql new file mode 100644 index 0000000000..2a2dc2aaf1 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.13__Alter_external_service_to_internal_model_mapping.sql @@ -0,0 +1,4 @@ + +USE catalogdb; + +ALTER TABLE external_service_to_internal_model_mapping MODIFY id int(11) not null auto_increment; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.14__DeactivateAndCloudDelete.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.14__DeactivateAndCloudDelete.sql new file mode 100644 index 0000000000..9c5c912d14 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.14__DeactivateAndCloudDelete.sql @@ -0,0 +1,10 @@ + +USE catalogdb; + +INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_MODEL_UUID) +VALUES +('vfModule', 'deactivateAndCloudDelete', '1', 'Gr api recipe to soft delete vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'); + +UPDATE vnf_components_recipe +SET description = 'Vnf api recipe to soft delete vf-module' +WHERE description = 'VID_DEFAULT vfModule soft delete'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql new file mode 100644 index 0000000000..9992f5531a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql @@ -0,0 +1,93 @@ +USE catalogdb; + +ALTER TABLE building_block_detail +CHANGE COLUMN building_block_name BUILDING_BLOCK_NAME VARCHAR(50) NOT NULL, +CHANGE COLUMN resource_type RESOURCE_TYPE VARCHAR(25) NOT NULL, +CHANGE COLUMN target_action TARGET_ACTION VARCHAR(25) NOT NULL; +/* +SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CHANGE ', COLUMN_NAME, ' ', UPPER(COLUMN_NAME), ';') +FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'building_block_detail' AND COLUMN_NAME <> 'id'; +*/ + +ALTER TABLE orchestration_status_state_transition_directive +CHANGE COLUMN resource_type RESOURCE_TYPE VARCHAR(25) NOT NULL, +CHANGE COLUMN orchestration_status ORCHESTRATION_STATUS VARCHAR(25) NOT NULL, +CHANGE COLUMN target_action TARGET_ACTION VARCHAR(25) NOT NULL, +CHANGE COLUMN flow_directive FLOW_DIRECTIVE VARCHAR(25) NOT NULL; + +/* +SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CHANGE ', COLUMN_NAME, ' ', UPPER(COLUMN_NAME), ';') +FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'orchestration_status_state_transition_directive' AND COLUMN_NAME <> 'id'; +*/ + +ALTER TABLE building_block_detail +DROP INDEX building_block_name; + +ALTER TABLE building_block_detail +ADD UNIQUE KEY UK_building_block_name (BUILDING_BLOCK_NAME); + + +/* +SELECT DISTINCT FLOW_NAME FROM orchestration_flow_reference WHERE FLOW_NAME NOT IN +(SELECT building_block_name FROM building_block_detail); + */ + +UPDATE orchestration_flow_reference +SET FLOW_NAME = 'ActivateServiceInstanceBB' +WHERE FLOW_NAME = 'ActivateServiceInstance'; + +DELETE FROM orchestration_flow_reference +WHERE FLOW_NAME = 'DeactivateNetworkCollectionBB'; + +UPDATE orchestration_flow_reference +SET SEQ_NO = SEQ_NO - 1 +WHERE COMPOSITE_ACTION = 'Service-Macro-Delete' AND SEQ_NO > 8; + +UPDATE orchestration_flow_reference +SET SEQ_NO = SEQ_NO - 1 +WHERE COMPOSITE_ACTION = 'NetworkCollection-Macro-Delete' AND SEQ_NO > 4; + +UPDATE building_block_detail +SET BUILDING_BLOCK_NAME = 'UnassignVolumeGroupBB' +WHERE BUILDING_BLOCK_NAME = 'UnassignVolumeGroup'; + +UPDATE building_block_detail +SET TARGET_ACTION = 'CHANGE_MODEL' +WHERE TARGET_ACTION = 'CHANGEMODEL'; + +INSERT INTO building_block_detail(BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION) +VALUES +('UnassignVfModuleBB', 'VF_MODULE', 'UNASSIGN'), +('AssignAndActivateVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), +('AvpnAssignServiceInstanceBB', 'CUSTOM', 'CUSTOM'), +('CreateCustomerVpnBindingBB', 'CUSTOM', 'CUSTOM'), +('SniroHoming', 'CUSTOM', 'CUSTOM'), +('DeactivateAndUnassignVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), +('DeactivateNetworkCollectionBB', 'CUSTOM', 'CUSTOM'), +('AAICheckVnfInMaintBB', 'CUSTOM', 'CUSTOM'), +('AAISetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), +('AAIUnsetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), +('SDNOVnfHealthCheckBB', 'CUSTOM', 'CUSTOM'), +('VNF-Macro-Replace', 'CUSTOM', 'CUSTOM'), +('HomingV2', 'CUSTOM', 'CUSTOM'); + +ALTER TABLE building_block_detail +MODIFY COLUMN BUILDING_BLOCK_NAME VARCHAR(200); + +ALTER TABLE orchestration_flow_reference +ADD CONSTRAINT fk_orchestration_flow_reference__building_block_detail +FOREIGN KEY (FLOW_NAME) REFERENCES building_block_detail(BUILDING_BLOCK_NAME) +ON DELETE CASCADE +ON UPDATE CASCADE; + +INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) +VALUES +('CUSTOM', 'ACTIVE', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'ASSIGNED', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'CREATED', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'INVENTORIED', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PRECREATED', 'CUSTOM', 'CONTINUE'); diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.16__Remove_Orchestration_Flow_Reference_FK_To_Building_Block_Detail_Pre_New_Solution.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.16__Remove_Orchestration_Flow_Reference_FK_To_Building_Block_Detail_Pre_New_Solution.sql new file mode 100644 index 0000000000..ee3cdd21ac --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.16__Remove_Orchestration_Flow_Reference_FK_To_Building_Block_Detail_Pre_New_Solution.sql @@ -0,0 +1,4 @@ +USE catalogdb; + +ALTER TABLE orchestration_flow_reference +DROP FOREIGN KEY fk_orchestration_flow_reference__building_block_detail; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.17__DeactivateAndCloudDeleteChanges.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.17__DeactivateAndCloudDeleteChanges.sql new file mode 100644 index 0000000000..77b4e60d49 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.17__DeactivateAndCloudDeleteChanges.sql @@ -0,0 +1,8 @@ +USE catalogdb; + +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW) VALUES +('VFModule-DeactivateAndCloudDelete', 'deactivateAndCloudDelete', 'VfModule', true, '7','7', true); + +INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES +('VFModule-DeactivateAndCloudDelete', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-DeactivateAndCloudDelete')), +('VFModule-DeactivateAndCloudDelete', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-DeactivateAndCloudDelete')); diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.18__AlterVNFRecipeVnfTypeColumnName.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.18__AlterVNFRecipeVnfTypeColumnName.sql new file mode 100644 index 0000000000..44a35b9d58 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.18__AlterVNFRecipeVnfTypeColumnName.sql @@ -0,0 +1,9 @@ +USE catalogdb; + +ALTER TABLE `vnf_recipe` +CHANGE COLUMN `VNF_TYPE` `NF_ROLE` VARCHAR(200) NULL DEFAULT NULL ; + +INSERT INTO `vnf_recipe` (`NF_ROLE`, `ACTION`, `VERSION_STR`, `DESCRIPTION`, `ORCHESTRATION_URI`, `RECIPE_TIMEOUT`) +VALUES ('vCE', 'replaceInstance', '1', 'custom bpmn for vCE recreate via POLO', '/mso/async/services/RecreateInfraVce', '180'); + +DELETE FROM `vnf_recipe` WHERE `NF_ROLE`='POLO_DEFAULT'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.1__Update_Recipe_For_API_Flag.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.1__Update_Recipe_For_API_Flag.sql new file mode 100644 index 0000000000..74e57e6647 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.1__Update_Recipe_For_API_Flag.sql @@ -0,0 +1,34 @@ +USE catalogdb; + +UPDATE vnf_recipe +SET ORCHESTRATION_URI = '/mso/async/services/VnfInPlaceUpdate' +WHERE VNF_TYPE = 'GR-API-DEFAULT' AND ACTION = 'inPlaceSoftwareUpdate'; + +UPDATE vnf_recipe +SET ORCHESTRATION_URI = '/mso/async/services/VnfConfigUpdate' +WHERE VNF_TYPE = 'GR-API-DEFAULT' AND ACTION = 'applyUpdatedConfig'; + +UPDATE service +SET MODEL_UUID = 'd88da85c-d9e8-4f73-b837-3a72a431622b' +WHERE MODEL_UUID = 'DummyGRApiDefaultModelUUID?'; + +UPDATE service +SET MODEL_INVARIANT_UUID = '944862ae-bb65-4429-8330-a6c9170d6672' +WHERE MODEL_INVARIANT_UUID = 'DummyGRApiDefaultModelInvariantUUID?'; + +UPDATE service_recipe +SET SERVICE_MODEL_UUID = 'd88da85c-d9e8-4f73-b837-3a72a431622b' +WHERE SERVICE_MODEL_UUID = 'DummyGRApiDefaultModelUUID?'; + +INSERT INTO service_recipe (ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, SERVICE_MODEL_UUID) +VALUES +('assignInstance', '1.0', 'Gr api recipe to assign service-instance', '/mso/async/services/WorkflowActionBB', 180, 'd88da85c-d9e8-4f73-b837-3a72a431622b'), +('unassignInstance', '1.0', 'Gr api recipe to unassign service-instance', '/mso/async/services/WorkflowActionBB', 180, 'd88da85c-d9e8-4f73-b837-3a72a431622b'); + +UPDATE service_recipe +SET DESCRIPTION = 'Vnf api recipe to assign service-instance' +WHERE ACTION = 'assignInstance' AND DESCRIPTION LIKE '%VID_DEFAULT%'; + +UPDATE service_recipe +SET DESCRIPTION = 'Vnf api recipe to unassign service-instance' +WHERE ACTION = 'unassignInstance' AND DESCRIPTION LIKE '%VID_DEFAULT%'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.2__ONAP_TABLE_CHANGES.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.2__ONAP_TABLE_CHANGES.sql new file mode 100644 index 0000000000..f90b18c28d --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.2__ONAP_TABLE_CHANGES.sql @@ -0,0 +1,30 @@ +use catalogdb; +create table if not exists ar_recipe ( + ID INT(11) not null auto_increment, + MODEL_NAME varchar(200) NOT NULL, + ACTION varchar(200) NOT NULL, + VERSION_STR varchar(200) NOT NULL, + SERVICE_TYPE varchar(200), + DESCRIPTION varchar(200), + ORCHESTRATION_URI varchar(200) NOT NULL, + AR_PARAM_XSD varchar(200), + RECIPE_TIMEOUT INT(11), + CREATION_TIMESTAMP DATETIME NOT NULL default current_timestamp, + primary key (ID), + unique key `uk_ar_recipe` (`model_name`,`action`,`version_str`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +alter table network_recipe + ADD RESOURCE_CATEGORY varchar(200), + ADD RESOURCE_SUB_CATEGORY varchar(200); + +alter table service ADD SERVICE_CATEGORY varchar(200); + +alter table vnf_resource + ADD RESOURCE_CATEGORY varchar(200), + ADD RESOURCE_SUB_CATEGORY varchar(200); + +alter table network_resource + ADD RESOURCE_CATEGORY varchar(200), + ADD RESOURCE_SUB_CATEGORY varchar(200); + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.3__MacroTableChanges.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.3__MacroTableChanges.sql new file mode 100644 index 0000000000..4a74edb245 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.3__MacroTableChanges.sql @@ -0,0 +1,24 @@ +USE catalogdb; + + + +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'Service-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'Service-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'assignService' WHERE MACRO_ACTION = 'Service-Macro-Assign'; +UPDATE northbound_request_ref_lookup SET ACTION = 'activateService' WHERE MACRO_ACTION = 'Service-Macro-Activate'; +UPDATE northbound_request_ref_lookup SET ACTION = 'unassignService' WHERE MACRO_ACTION = 'Service-Macro-Unassign'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'Service-Macro-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'Service-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'Network-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'Network-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'replaceService' WHERE MACRO_ACTION = 'VNF-Macro-Replace'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'VNF-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'VNF-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'VolumeGroup-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'VolumeGroup-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'VFModule-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'VFModule-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'deleteService' WHERE MACRO_ACTION = 'AVPNBonding-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET ACTION = 'createService' WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.4__MacroReferenceData1806.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.4__MacroReferenceData1806.sql new file mode 100644 index 0000000000..2e264d9bbc --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.4__MacroReferenceData1806.sql @@ -0,0 +1,130 @@ + +USE catalogdb; + +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION) VALUES +('Service-Create', 'createInstance', 'Service', true, '7','7'), +('Service-Delete', 'deleteInstance', 'Service', true, '7','7'), +('Service-Macro-Assign', 'assignInstance', 'Service', false, '7','7'), +('Service-Macro-Activate', 'activateInstance', 'Service', false, '7','7'), +('Service-Macro-Unassign', 'unassignInstance', 'Service', false, '7','7'), +('Service-Macro-Create', 'createInstance', 'Service', false, '7','7'), +('Service-Macro-Delete', 'deleteInstance', 'Service', false, '7','7'), +('Network-Create', 'createInstance', 'Network', true, '7','7'), +('Network-Delete', 'deleteInstance', 'Network', true, '7','7'), +('VNF-Macro-Recreate', 'replaceInstance', 'Vnf', false, '7','7'), +('VNF-Macro-Replace', 'internalReplace', 'Vnf', false, '7','7'), +('VNF-Create', 'createInstance', 'Vnf', true, '7', '7'), +('VNF-Delete', 'deleteInstance', 'Vnf', true, '7', '7'), +('VolumeGroup-Create', 'createInstance', 'VolumeGroup', true, '7','7'), +('VolumeGroup-Delete', 'deleteInstance', 'VolumeGroup', true, '7','7'), +('VFModule-Create', 'createInstance', 'VfModule', true, '7','7'), +('VFModule-Delete', 'deleteInstance', 'VfModule', true, '7','7'), +('NetworkCollection-Macro-Create', 'createInstance', 'NetworkCollection', false, '7','7'), +('NetworkCollection-Macro-Delete', 'deleteInstance', 'NetworkCollection', false, '7','7'), +('AVPNBonding-Macro-Delete', 'deleteInstance', 'BondingService', true, '7','7'), +('AVPNBonding-Macro-Create', 'createInstance', 'BondingService', true, '7','7'); + +INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES +('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create')), +('Service-Create', '2', 'ActivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create')), +('Service-Delete', '1', 'DeactivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Delete')), +('Service-Delete', '2', 'UnassignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Delete')), +('Service-Macro-Assign', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign')), +('Service-Macro-Assign', '2', 'AssignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign')), +('Service-Macro-Assign', '3', 'AssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign')), +('Service-Macro-Assign', '4', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign')), +('Service-Macro-Assign', '5', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign')), +('Service-Macro-Activate', '1', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '2', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '3', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '4', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '5', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '6', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '7', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Activate', '8', 'ActivateServiceInstance', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate')), +('Service-Macro-Unassign', '1', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign')), +('Service-Macro-Unassign', '2', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign')), +('Service-Macro-Unassign', '3', 'UnassignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign')), +('Service-Macro-Unassign', '4', 'UnassignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign')), +('Service-Macro-Unassign', '5', 'UnassignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign')), +('Service-Macro-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '2', 'CreateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '3', 'AssignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '4', 'AssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '5', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '6', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '7', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '8', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '9', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '10', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '11', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '12', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '13', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '14', 'ActivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Create', '15', 'ActivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create')), +('Service-Macro-Delete', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '3', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '4', 'DeleteVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '5', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '6', 'DeactivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '7', 'DeleteNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '8', 'DeactivateNetworkCollectionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '9', 'DeleteNetworkCollectionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '10', 'DeactivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '11', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '12', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '13', 'UnassignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '14', 'UnassignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '15', 'UnassignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Network-Create', '1', 'AssignNetwork1802BB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create')), +('Network-Create', '2', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create')), +('Network-Create', '3', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create')), +('Network-Delete', '1', 'DeactivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Delete')), +('Network-Delete', '2', 'DeleteNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Delete')), +('Network-Delete', '3', 'UnassignNetwork1802BB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Delete')), +('VNF-Create', '1', 'AssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Create')), +('VNF-Create', '2', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Create')), +('VNF-Delete', '1', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Delete')), +('VNF-Delete', '2', 'UnassignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Delete')), +('VNF-Macro-Recreate', '1', 'AAICheckVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate')), +('VNF-Macro-Recreate', '2', 'AAISetVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate')), +('VNF-Macro-Recreate', '3', 'VNF-Macro-Replace', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate')), +('VNF-Macro-Recreate', '4', 'SDNOVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate')), +('VNF-Macro-Recreate', '5', 'AAIUnsetVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate')), +('VNF-Macro-Replace', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace')), +('VNF-Macro-Replace', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace')), +('VNF-Macro-Replace', '3', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace')), +('VNF-Macro-Replace', '4', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace')), +('VNF-Macro-Replace', '5', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace')), +('VNF-Macro-Replace', '6', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace')), +('VolumeGroup-Create', '1', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Create')), +('VolumeGroup-Create', '2', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Create')), +('VolumeGroup-Create', '3', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Create')), +('VolumeGroup-Delete', '1', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Delete')), +('VolumeGroup-Delete', '2', 'DeleteVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Delete')), +('VolumeGroup-Delete', '3', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Delete')), +('VFModule-Create', '1', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Create')), +('VFModule-Create', '2', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Create')), +('VFModule-Create', '3', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Create')), +('VFModule-Delete', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete')), +('VFModule-Delete', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete')), +('VFModule-Delete', '3', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete')), +('NetworkCollection-Macro-Create', '1', 'CreateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create')), +('NetworkCollection-Macro-Create', '2', 'AssignNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create')), +('NetworkCollection-Macro-Create', '3', 'CreateNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create')), +('NetworkCollection-Macro-Create', '4', 'ActivateNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create')), +('NetworkCollection-Macro-Create', '5', 'ActivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create')), +('NetworkCollection-Macro-Delete', '1', 'DeactivateNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete')), +('NetworkCollection-Macro-Delete', '2', 'DeleteNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete')), +('NetworkCollection-Macro-Delete', '3', 'UnassignNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete')), +('NetworkCollection-Macro-Delete', '4', 'DeactivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete')), +('NetworkCollection-Macro-Delete', '5', 'DeleteNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete')), +('AVPNBonding-Macro-Delete','1','DeactivateServiceInstanceBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Delete')), +('AVPNBonding-Macro-Delete','2','DeactivateAndUnassignVpnBondingLinksBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Delete')), +('AVPNBonding-Macro-Delete','3','UnassignServiceInstanceBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Delete')), +('AVPNBonding-Macro-Create','1','SniroHoming',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create')), +('AVPNBonding-Macro-Create','2','CreateCustomerVpnBindingBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create')), +('AVPNBonding-Macro-Create','3','AvpnAssignServiceInstanceBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create')), +('AVPNBonding-Macro-Create','4','AssignAndActivateVpnBondingLinksBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create')), +('AVPNBonding-Macro-Create','5','ActivateServiceInstanceBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create')); diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.5__RainyDayHandlerMacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.5__RainyDayHandlerMacroData.sql new file mode 100644 index 0000000000..b81688e47d --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.5__RainyDayHandlerMacroData.sql @@ -0,0 +1,45 @@ +use catalogdb; + +INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY) +VALUES +('ActivateNetworkBB', '*', '*', '*', "*" , 'Rollback'), +('ActivateNetworkCollectionBB', '*', '*', '*', "*" , 'Rollback'), +('ActivateServiceInstanceBB', '*', '*', '*', "*" , 'Rollback'), +('ActivateVfModuleBB', '*', '*', '*', "*" , 'Rollback'), +('ActivateVnfBB', '*', '*', '*', "*" , 'Rollback'), +('ActivateVolumeGroupBB', '*', '*', '*', "*" , 'Rollback'), +('AssignNetwork1802BB', '*', '*', '*', "*" , 'Rollback'), +('AssignNetworkBB', '*', '*', '*', "*" , 'Rollback'), +('AssignServiceInstanceBB', '*', '*', '*', "*" , 'Rollback'), +('AssignVfModuleBB', '*', '*', '*', "*" , 'Rollback'), +('AssignVnfBB', '*', '*', '*', "*" , 'Rollback'), +('AssignVolumeGroupBB', '*', '*', '*', "*" , 'Rollback'), +('CreateNetworkBB', '*', '*', '*', "*" , 'Retry'), +('CreateNetworkCollectionBB', '*', '*', '*', "*" , 'Retry'), +('CreateVfModuleBB', '*', '*', '*', "*" , 'Retry'), +('CreateVolumeGroupBB', '*', '*', '*', "*" , 'Retry'), +('ChangeModelServiceInstanceBB', '*', '*', '*', "*" , 'Abort'), +('ChangeModelVfModuleBB', '*', '*', '*', "*" , 'Abort'), +('ChangeModelVnfBB', '*', '*', '*', "*" , 'Abort'), +('CreateCustomerBB', '*', '*', '*', "*" , 'Abort'), +('DeactivateNetworkBB', '*', '*', '*', "*" , 'Abort'), +('DeactivateServiceInstanceBB', '*', '*', '*', "*" , 'Abort'), +('DeactivateVfModuleBB', '*', '*', '*', "*" , 'Abort'), +('DeactivateVnfBB', '*', '*', '*', "*" , 'Abort'), +('DeactivateVolumeGroupBB', '*', '*', '*', "*" , 'Abort'), +('DeleteNetworkBB', '*', '*', '*', "*" , 'Retry'), +('DeleteNetworkCollectionBB', '*', '*', '*', "*" , 'Retry'), +('DeleteVfModuleBB', '*', '*', '*', "*" , 'Retry'), +('DeleteVolumeGroupBB', '*', '*', '*', "*" , 'Retry'), +('UnassignNetwork1802BB', '*', '*', '*', "*" , 'Retry'), +('UnassignNetworkBB', '*', '*', '*', "*" , 'Retry'), +('UnassignServiceInstanceBB', '*', '*', '*', "*" , 'Retry'), +('UnassignVfModuleBB', '*', '*', '*', "*" , 'Retry'), +('UnassignVnfBB', '*', '*', '*', "*" , 'Retry'), +('UnassignVolumeGroupBB', '*', '*', '*', "*" , 'Retry'), +('UpdateNetworkBB', '*', '*', '*', "*" , 'Retry'), +('VnfAdapterBB', '*', '*', '*', "*" , 'Retry'), +('AAICheckVnfInMaintBB', '*', '*', '*', "*" , 'Abort'), +('AAISetVnfInMaintBB', '*', '*', '*', "*" , 'Abort'), +('SDNOVnfHealthCheckBB', '*', '*', '*', "*" , 'Abort'), +('AAIUnsetVnfInMaintBB', '*', '*', '*', "*" , 'Abort'); \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.6__NorthboundAddTopLevelFlow.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.6__NorthboundAddTopLevelFlow.sql new file mode 100644 index 0000000000..ee2b63c079 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.6__NorthboundAddTopLevelFlow.sql @@ -0,0 +1,28 @@ +USE catalogdb; + +ALTER TABLE + `northbound_request_ref_lookup` +ADD + ISTOPLEVELFLOW TINYINT(1); + +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Macro-Assign'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Macro-Activate'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Macro-Unassign'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Macro-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Service-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Network-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'Network-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = FALSE WHERE MACRO_ACTION = 'VNF-Macro-Replace'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VNF-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VNF-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VolumeGroup-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VolumeGroup-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VFModule-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VFModule-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'AVPNBonding-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'AVPNBonding-Macro-Create'; +UPDATE northbound_request_ref_lookup SET ISTOPLEVELFLOW = TRUE WHERE MACRO_ACTION = 'VNF-Macro-Recreate'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql new file mode 100644 index 0000000000..d83d6ecad9 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql @@ -0,0 +1,57 @@ +use catalogdb; + +CREATE TABLE IF NOT EXISTS `catalogdb`.`collection_resource_instance_group_customization` ( + `COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID` VARCHAR(200) NOT NULL, + `INSTANCE_GROUP_MODEL_UUID` VARCHAR(200) NOT NULL, + `FUNCTION` VARCHAR(200) NULL, + `DESCRIPTION` VARCHAR(1200) NULL, + `SUBINTERFACE_NETWORK_QUANTITY` INT(11) NULL, + `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID`, `INSTANCE_GROUP_MODEL_UUID`), + INDEX `fk_collection_resource_instance_group_customization__instan_idx` (`INSTANCE_GROUP_MODEL_UUID` ASC), + CONSTRAINT `fk_collection_resource_instance_group_customization__collecti1` + FOREIGN KEY (`COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID`) + REFERENCES `catalogdb`.`collection_resource_customization` (`MODEL_CUSTOMIZATION_UUID`) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT `fk_collection_resource_instance_group_customization__instance1` + FOREIGN KEY (`INSTANCE_GROUP_MODEL_UUID`) + REFERENCES `catalogdb`.`instance_group` (`MODEL_UUID`) + ON DELETE CASCADE + ON UPDATE CASCADE) +ENGINE = InnoDB +DEFAULT CHARACTER SET = latin1; + +CREATE TABLE IF NOT EXISTS `catalogdb`.`vnfc_instance_group_customization` ( + `VNF_RESOURCE_CUSTOMIZATION_MODEL_UUID` VARCHAR(200) NOT NULL, + `INSTANCE_GROUP_MODEL_UUID` VARCHAR(200) NOT NULL, + `FUNCTION` VARCHAR(200) NULL, + `DESCRIPTION` VARCHAR(1200) NULL, + `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`VNF_RESOURCE_CUSTOMIZATION_MODEL_UUID`, `INSTANCE_GROUP_MODEL_UUID`), + INDEX `fk_vnfc_instance_group_customization__instance_group1_idx` (`INSTANCE_GROUP_MODEL_UUID` ASC), + CONSTRAINT `fk_vnfc_instance_group_customization__vnf_resource_customizat1` + FOREIGN KEY (`VNF_RESOURCE_CUSTOMIZATION_MODEL_UUID`) + REFERENCES `catalogdb`.`vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT `fk_vnfc_instance_group_customization__instance_group1` + FOREIGN KEY (`INSTANCE_GROUP_MODEL_UUID`) + REFERENCES `catalogdb`.`instance_group` (`MODEL_UUID`) + ON DELETE CASCADE + ON UPDATE CASCADE) +ENGINE = InnoDB +DEFAULT CHARACTER SET = latin1; + +Alter TABLE `instance_group` +DROP COLUMN `function`, +DROP COLUMN `description`, +CHANGE `primary_type` `object_type` varchar(200) NOT NULL, +MODIFY `tosca_node_type` varchar(200) NULL; + +Alter TABLE `collection_resource_customization` +DROP COLUMN `subinterface_network_quantity`, +CHANGE `primary_type` `object_type` varchar(200) NOT NULL, +MODIFY role varchar(200) NULL, +MODIFY function varchar(200) NULL, +MODIFY collection_resource_type varchar(200) NULL; diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.8__OrchestrationStatus_ValidActionStateTransition.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.8__OrchestrationStatus_ValidActionStateTransition.sql new file mode 100644 index 0000000000..1f3e7906ec --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.8__OrchestrationStatus_ValidActionStateTransition.sql @@ -0,0 +1,398 @@ +USE catalogdb; + +CREATE TABLE IF NOT EXISTS `building_block_detail` ( +`id` INT(11) AUTO_INCREMENT, +`building_block_name` VARCHAR(50) UNIQUE NOT NULL, +`resource_type` VARCHAR(25) NOT NULL, +`target_action` VARCHAR(25) NOT NULL, +PRIMARY KEY(`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = latin1; + +INSERT INTO building_block_detail (building_block_name, resource_type, target_action) +VALUES +('AssignServiceInstanceBB', 'SERVICE', 'ASSIGN'), +('AssignVnfBB', 'VNF', 'ASSIGN'), +('AssignVolumeGroupBB', 'VOLUME_GROUP', 'ASSIGN'), +('AssignVfModuleBB', 'VF_MODULE', 'ASSIGN'), +('AssignNetworkBB', 'NETWORK', 'ASSIGN'), +('AssignNetwork1802BB', 'NETWORK', 'ASSIGN'), + +('UnassignServiceInstanceBB', 'SERVICE', 'UNASSIGN'), +('UnassignVnfBB', 'VNF', 'UNASSIGN'), +('UnassignVolumeGroup', 'VOLUME_GROUP', 'UNASSIGN'), +('UnassignNetwork1802BB', 'NETWORK', 'UNASSIGN'), +('UnassignNetworkBB', 'NETWORK', 'UNASSIGN'), + +('ActivateServiceInstanceBB', 'SERVICE', 'ACTIVATE'), +('ActivateVnfBB', 'VNF', 'ACTIVATE'), +('ActivateVolumeGroupBB', 'VOLUME_GROUP', 'ACTIVATE'), +('ActivateVfModuleBB', 'VF_MODULE', 'ACTIVATE'), +('ActivateNetworkBB', 'NETWORK', 'ACTIVATE'), +('ActivateNetworkCollectionBB', 'NETWORK', 'ACTIVATE'), + +('DeactivateServiceInstanceBB', 'SERVICE', 'DEACTIVATE'), +('DeactivateVnfBB', 'VNF', 'DEACTIVATE'), +('DeactivateVolumeGroupBB', 'VOLUME_GROUP', 'DEACTIVATE'), +('DeactivateVfModuleBB', 'VF_MODULE', 'DEACTIVATE'), +('DeactivateNetworkBB', 'NETWORK', 'DEACTIVATE'), + + +('ChangeModelServiceInstanceBB', 'SERVICE', 'CHANGEMODEL'), +('ChangeModelVnfBB', 'VNF', 'CHANGEMODEL'), +('ChangeModelVfModuleBB', 'VF_MODULE', 'CHANGEMODEL'), + + +('CreateVolumeGroupBB', 'VOLUME_GROUP', 'CREATE'), +('CreateVfModuleBB', 'VF_MODULE', 'CREATE'), +('CreateNetworkBB', 'NETWORK', 'CREATE'), +('CreateNetworkCollectionBB', 'NETWORK', 'CREATE'), + +('DeleteVolumeGroupBB', 'VOLUME_GROUP', 'DELETE'), +('DeleteVfModuleBB', 'VF_MODULE', 'DELETE'), +('DeleteNetworkBB', 'NETWORK', 'DELETE'), +('DeleteNetworkCollectionBB', 'NETWORK', 'DELETE'); + +CREATE TABLE IF NOT EXISTS `orchestration_status_state_transition_directive` ( +`id` INT(11) AUTO_INCREMENT, +`resource_type` VARCHAR(25) NOT NULL, +`orchestration_status` VARCHAR(25) NOT NULL, +`target_action` VARCHAR(25) NOT NULL, +`flow_directive` VARCHAR(25) NOT NULL, +PRIMARY KEY (`id`), +UNIQUE KEY `UK_orchestration_status_state_transition_directive` (`resource_type`, `orchestration_status`, `target_action`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = latin1; + +INSERT INTO orchestration_status_state_transition_directive (resource_type, orchestration_status, target_action, flow_directive) +VALUES + +('SERVICE', 'PRECREATED', 'ASSIGN', 'CONTINUE'), +('VNF', 'PRECREATED', 'ASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'PRECREATED', 'ASSIGN', 'CONTINUE'), +('VF_MODULE', 'PRECREATED', 'ASSIGN', 'CONTINUE'), +('NETWORK', 'PRECREATED', 'ASSIGN', 'CONTINUE'), + +('SERVICE', 'INVENTORIED', 'ASSIGN', 'CONTINUE'), +('VNF', 'INVENTORIED', 'ASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'INVENTORIED', 'ASSIGN', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'ASSIGN', 'CONTINUE'), +('NETWORK', 'INVENTORIED', 'ASSIGN', 'CONTINUE'), + +('SERVICE', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'), +('VNF', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'), +('VF_MODULE', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'), + +('SERVICE', 'CREATED', 'ASSIGN', 'SILENT_SUCCESS'), +('VNF', 'CREATED', 'ASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'CREATED', 'ASSIGN', 'FAIL'), +('VF_MODULE', 'CREATED', 'ASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'CREATED', 'ASSIGN', 'SILENT_SUCCESS'), + +('SERVICE', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'), +('VNF', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'), +('VF_MODULE', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'), + +('SERVICE', 'PENDING_CREATE', 'ASSIGN', 'FAIL'), +('VNF', 'PENDING_CREATE', 'ASSIGN', 'FAIL'), +('VOLUME_GROUP', 'PENDING_CREATE', 'ASSIGN', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'ASSIGN', 'CONTINUE'), +('NETWORK', 'PENDING_CREATE', 'ASSIGN', 'SILENT_SUCCESS'), + +('SERVICE', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'), +('VNF', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'PENDING_DELETE', 'ASSIGN', 'FAIL'), +('VF_MODULE', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'), + +('SERVICE', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'), +('VNF', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'), +('VOLUME_GROUP', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'), +('VF_MODULE', 'PENDING_ACTIVATION', 'ASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'), + +('SERVICE', 'PENDING', 'ASSIGN', 'FAIL'), +('VNF', 'PENDING', 'ASSIGN', 'FAIL'), +('VOLUME_GROUP', 'PENDING', 'ASSIGN', 'SILENT_SUCCESS'), +('VF_MODULE', 'PENDING', 'ASSIGN', 'FAIL'), +('NETWORK', 'PENDING', 'ASSIGN', 'FAIL'), + + +('SERVICE', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'), +('VNF', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'), +('VF_MODULE', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'), + +('SERVICE', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'INVENTORIED', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'), +('NETWORK', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'), + +('SERVICE', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'), +('VF_MODULE', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'), +('NETWORK', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'), + +('SERVICE', 'CREATED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CREATED', 'UNASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'CREATED', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'CREATED', 'UNASSIGN', 'FAIL'), +('NETWORK', 'CREATED', 'UNASSIGN', 'FAIL'), + +('SERVICE', 'ACTIVE', 'UNASSIGN', 'FAIL'), +('VNF', 'ACTIVE', 'UNASSIGN', 'FAIL'), +('VOLUME_GROUP', 'ACTIVE', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'ACTIVE', 'UNASSIGN', 'FAIL'), +('NETWORK', 'ACTIVE', 'UNASSIGN', 'FAIL'), + +('SERVICE', 'PENDING_CREATE', 'UNASSIGN', 'FAIL'), +('VNF', 'PENDING_CREATE', 'UNASSIGN', 'FAIL'), +('VOLUME_GROUP', 'PENDING_CREATE', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'UNASSIGN', 'CONTINUE'), +('NETWORK', 'PENDING_CREATE', 'UNASSIGN', 'CONTINUE'), + +('SERVICE', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'), +('VNF', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'), +('VOLUME_GROUP', 'PENDING_DELETE', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'), +('NETWORK', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'), + +('SERVICE', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'), +('VNF', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'), +('VOLUME_GROUP', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'PENDING_ACTIVATION', 'UNASSIGN', 'CONTINUE'), +('NETWORK', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'), + +('SERVICE', 'PENDING', 'UNASSIGN', 'FAIL'), +('VNF', 'PENDING', 'UNASSIGN', 'FAIL'), +('VOLUME_GROUP', 'PENDING', 'UNASSIGN', 'CONTINUE'), +('VF_MODULE', 'PENDING', 'UNASSIGN', 'FAIL'), +('NETWORK', 'PENDING', 'UNASSIGN', 'FAIL'), + + +('SERVICE', 'PRECREATED', 'ACTIVATE', 'FAIL'), +('VNF', 'PRECREATED', 'ACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PRECREATED', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'PRECREATED', 'ACTIVATE', 'FAIL'), +('NETWORK', 'PRECREATED', 'ACTIVATE', 'FAIL'), + +('SERVICE', 'INVENTORIED', 'ACTIVATE', 'FAIL'), +('VNF', 'INVENTORIED', 'ACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'INVENTORIED', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'ACTIVATE', 'FAIL'), +('NETWORK', 'INVENTORIED', 'ACTIVATE', 'FAIL'), + +('SERVICE', 'ASSIGNED', 'ACTIVATE', 'CONTINUE'), +('VNF', 'ASSIGNED', 'ACTIVATE', 'CONTINUE'), +('VOLUME_GROUP', 'ASSIGNED', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'ASSIGNED', 'ACTIVATE', 'FAIL'), +('NETWORK', 'ASSIGNED', 'ACTIVATE', 'FAIL'), + +('SERVICE', 'CREATED', 'ACTIVATE', 'CONTINUE'), +('VNF', 'CREATED', 'ACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'CREATED', 'ACTIVATE', 'CONTINUE'), +('VF_MODULE', 'CREATED', 'ACTIVATE', 'CONTINUE'), +('NETWORK', 'CREATED', 'ACTIVATE', 'CONTINUE'), + +('SERVICE', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'), +('VNF', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'), + +('SERVICE', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'), +('VNF', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'), +('NETWORK', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'), + +('SERVICE', 'PENDING_DELETE', 'ACTIVATE', 'CONTINUE'), +('VNF', 'PENDING_DELETE', 'ACTIVATE', 'CONTINUE'), +('VOLUME_GROUP', 'PENDING_DELETE', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING_DELETE', 'ACTIVATE', 'FAIL'), +('NETWORK', 'PENDING_DELETE', 'ACTIVATE', 'FAIL'), + +('SERVICE', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'), +('VNF', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'), +('NETWORK', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'), + +('SERVICE', 'PENDING', 'ACTIVATE', 'FAIL'), +('VNF', 'PENDING', 'ACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PENDING', 'ACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING', 'ACTIVATE', 'FAIL'), +('NETWORK', 'PENDING', 'ACTIVATE', 'FAIL'), + + +('SERVICE', 'PRECREATED', 'DEACTIVATE', 'FAIL'), +('VNF', 'PRECREATED', 'DEACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PRECREATED', 'DEACTIVATE', 'FAIL'), +('VF_MODULE', 'PRECREATED', 'DEACTIVATE', 'FAIL'), +('NETWORK', 'PRECREATED', 'DEACTIVATE', 'FAIL'), + +('SERVICE', 'INVENTORIED', 'DEACTIVATE', 'FAIL'), +('VNF', 'INVENTORIED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'INVENTORIED', 'DEACTIVATE', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'INVENTORIED', 'DEACTIVATE', 'SILENT_SUCCESS'), + +('SERVICE', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VNF', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'), + +('SERVICE', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VNF', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'), + +('SERVICE', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'), +('VNF', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'), +('VOLUME_GROUP', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'), +('VF_MODULE', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'), +('NETWORK', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'), + +('SERVICE', 'PENDING_CREATE', 'DEACTIVATE', 'FAIL'), +('VNF', 'PENDING_CREATE', 'DEACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PENDING_CREATE', 'DEACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'DEACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_CREATE', 'DEACTIVATE', 'SILENT_SUCCESS'), + +('SERVICE', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VNF', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'PENDING_DELETE', 'DEACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'), + +('SERVICE', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'), +('VNF', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'), +('VF_MODULE', 'PENDING_ACTIVATION', 'DEACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'), + +('SERVICE', 'PENDING', 'DEACTIVATE', 'FAIL'), +('VNF', 'PENDING', 'DEACTIVATE', 'FAIL'), +('VOLUME_GROUP', 'PENDING', 'DEACTIVATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'PENDING', 'DEACTIVATE', 'FAIL'), +('NETWORK', 'PENDING', 'DEACTIVATE', 'FAIL'), + + +('SERVICE', 'PRECREATED', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'PRECREATED', 'CHANGE_MODEL', 'FAIL'), +('VF_MODULE', 'PRECREATED', 'CHANGE_MODEL', 'FAIL'), + +('SERVICE', 'INVENTORIED', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'INVENTORIED', 'CHANGE_MODEL', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'CHANGE_MODEL', 'FAIL'), + +('SERVICE', 'ASSIGNED', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'ASSIGNED', 'CHANGE_MODEL', 'CONTINUE'), +('VF_MODULE', 'ASSIGNED', 'CHANGE_MODEL', 'CONTINUE'), + +('SERVICE', 'CREATED', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'CREATED', 'CHANGE_MODEL', 'FAIL'), +('VF_MODULE', 'CREATED', 'CHANGE_MODEL', 'FAIL'), + +('SERVICE', 'ACTIVE', 'CHANGE_MODEL', 'CONTINUE'), +('VNF', 'ACTIVE', 'CHANGE_MODEL', 'CONTINUE'), +('VF_MODULE', 'ACTIVE', 'CHANGE_MODEL', 'CONTINUE'), + +('SERVICE', 'PENDING_CREATE', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'PENDING_CREATE', 'CHANGE_MODEL', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'CHANGE_MODEL', 'FAIL'), + +('SERVICE', 'PENDING_DELETE', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'PENDING_DELETE', 'CHANGE_MODEL', 'CONTINUE'), +('VF_MODULE', 'PENDING_DELETE', 'CHANGE_MODEL', 'CONTINUE'), + +('SERVICE', 'PENDING_ACTIVATION', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'PENDING_ACTIVATION', 'CHANGE_MODEL', 'CONTINUE'), +('VF_MODULE', 'PENDING_ACTIVATION', 'CHANGE_MODEL', 'CONTINUE'), + +('SERVICE', 'PENDING', 'CHANGE_MODEL', 'FAIL'), +('VNF', 'PENDING', 'CHANGE_MODEL', 'FAIL'), +('VF_MODULE', 'PENDING', 'CHANGE_MODEL', 'FAIL'), + + +('VOLUME_GROUP', 'PRECREATED', 'CREATE', 'FAIL'), +('VF_MODULE', 'PRECREATED', 'CREATE', 'FAIL'), +('NETWORK', 'PRECREATED', 'CREATE', 'FAIL'), + +('VOLUME_GROUP', 'INVENTORIED', 'CREATE', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'CREATE', 'FAIL'), +('NETWORK', 'INVENTORIED', 'CREATE', 'FAIL'), + +('VOLUME_GROUP', 'ASSIGNED', 'CREATE', 'CONTINUE'), +('VF_MODULE', 'ASSIGNED', 'CREATE', 'CONTINUE'), +('NETWORK', 'ASSIGNED', 'CREATE', 'CONTINUE'), + +('VOLUME_GROUP', 'CREATED', 'CREATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'CREATED', 'CREATE', 'SILENT_SUCCESS'), +('NETWORK', 'CREATED', 'CREATE', 'SILENT_SUCCESS'), + +('VOLUME_GROUP', 'ACTIVE', 'CREATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'ACTIVE', 'CREATE', 'SILENT_SUCCESS'), +('NETWORK', 'ACTIVE', 'CREATE', 'SILENT_SUCCESS'), + +('VOLUME_GROUP', 'PENDING_CREATE', 'CREATE', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'CREATE', 'FAIL'), +('NETWORK', 'PENDING_CREATE', 'CREATE', 'CONTINUE'), + +('VOLUME_GROUP', 'PENDING_DELETE', 'CREATE', 'FAIL'), +('VF_MODULE', 'PENDING_DELETE', 'CREATE', 'CONTINUE'), +('NETWORK', 'PENDING_DELETE', 'CREATE', 'CONTINUE'), + +('VOLUME_GROUP', 'PENDING_ACTIVATION', 'CREATE', 'FAIL'), +('VF_MODULE', 'PENDING_ACTIVATION', 'CREATE', 'FAIL'), +('NETWORK', 'PENDING_ACTIVATION', 'CREATE', 'FAIL'), + +('VOLUME_GROUP', 'PENDING', 'CREATE', 'CONTINUE'), +('VF_MODULE', 'PENDING', 'CREATE', 'FAIL'), +('NETWORK', 'PENDING', 'CREATE', 'FAIL'), + + +('VOLUME_GROUP', 'PRECREATED', 'DELETE', 'FAIL'), +('VF_MODULE', 'PRECREATED', 'DELETE', 'FAIL'), +('NETWORK', 'PRECREATED', 'DELETE', 'FAIL'), + +('VOLUME_GROUP', 'INVENTORIED', 'DELETE', 'FAIL'), +('VF_MODULE', 'INVENTORIED', 'DELETE', 'SILENT_SUCCESS'), +('NETWORK', 'INVENTORIED', 'DELETE', 'SILENT_SUCCESS'), + +('VOLUME_GROUP', 'ASSIGNED', 'DELETE', 'SILENT_SUCCESS'), +('VF_MODULE', 'ASSIGNED', 'DELETE', 'SILENT_SUCCESS'), +('NETWORK', 'ASSIGNED', 'DELETE', 'SILENT_SUCCESS'), + +('VOLUME_GROUP', 'CREATED', 'DELETE', 'CONTINUE'), +('VF_MODULE', 'CREATED', 'DELETE', 'CONTINUE'), +('NETWORK', 'CREATED', 'DELETE', 'CONTINUE'), + +('VOLUME_GROUP', 'ACTIVE', 'DELETE', 'FAIL'), +('VF_MODULE', 'ACTIVE', 'DELETE', 'FAIL'), +('NETWORK', 'ACTIVE', 'DELETE', 'FAIL'), + +('VOLUME_GROUP', 'PENDING_CREATE', 'DELETE', 'FAIL'), +('VF_MODULE', 'PENDING_CREATE', 'DELETE', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_CREATE', 'DELETE', 'SILENT_SUCCESS'), + +('VOLUME_GROUP', 'PENDING_DELETE', 'DELETE', 'FAIL'), +('VF_MODULE', 'PENDING_DELETE', 'DELETE', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_DELETE', 'DELETE', 'SILENT_SUCCESS'), + +('VOLUME_GROUP', 'PENDING_ACTIVATION', 'DELETE', 'FAIL'), +('VF_MODULE', 'PENDING_ACTIVATION', 'DELETE', 'SILENT_SUCCESS'), +('NETWORK', 'PENDING_ACTIVATION', 'DELETE', 'FAIL'), + +('VOLUME_GROUP', 'PENDING', 'DELETE', 'SILENT_SUCCESS'), +('VF_MODULE', 'PENDING', 'DELETE', 'FAIL'), +('NETWORK', 'PENDING', 'DELETE', 'FAIL'); diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.9__UpdateIsTopLevelFlowColumn.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.9__UpdateIsTopLevelFlowColumn.sql new file mode 100644 index 0000000000..855b1715ff --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.9__UpdateIsTopLevelFlowColumn.sql @@ -0,0 +1,4 @@ +USE catalogdb; + +ALTER TABLE + `northbound_request_ref_lookup` CHANGE ISTOPLEVELFLOW IS_TOPLEVELFLOW TINYINT(1); \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.1__AddServiceMacroDeactivateToMacroTables.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.1__AddServiceMacroDeactivateToMacroTables.sql new file mode 100644 index 0000000000..d8291b7712 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.1__AddServiceMacroDeactivateToMacroTables.sql @@ -0,0 +1,7 @@ +USE catalogdb; + +INSERT INTO northbound_request_ref_lookup (REQUEST_SCOPE, MACRO_ACTION, ACTION, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW) +values ( 'Service', 'Service-Macro-Deactivate', 'deactivateInstance', '0', '7', '7', '1'); + +INSERT INTO orchestration_flow_reference (COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) +values ( 'Service-Macro-Deactivate', '1', 'DeactivateServiceInstanceBB', '1', (SELECT id FROM northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Deactivate')); \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.2__ChangeMINApiVersionInNorthbound.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.2__ChangeMINApiVersionInNorthbound.sql new file mode 100644 index 0000000000..9016d5bf93 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.2__ChangeMINApiVersionInNorthbound.sql @@ -0,0 +1,5 @@ +USE catalogdb; + +UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Create'; +UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Delete'; +UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Activate'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.3__ChangeMINApiVersionServiceMacroDeactivate.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.3__ChangeMINApiVersionServiceMacroDeactivate.sql new file mode 100644 index 0000000000..a471e2d0a5 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.3__ChangeMINApiVersionServiceMacroDeactivate.sql @@ -0,0 +1,3 @@ +USE catalogdb; + +UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Deactivate'; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.4__AddUpdateNetworkALaCarte.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.4__AddUpdateNetworkALaCarte.sql new file mode 100644 index 0000000000..350dde6b9a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.4__AddUpdateNetworkALaCarte.sql @@ -0,0 +1,20 @@ +USE catalogdb; + +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW) VALUES +('Network-Update', 'updateInstance', 'Network', true, '7','7','1'); + +INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES +('Network-Update', '1', 'UpdateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Update')); + +INSERT INTO building_block_detail(BUILDING_BLOCK_NAME,RESOURCE_TYPE,TARGET_ACTION) VALUES +('UpdateNetworkBB','NETWORK','UPDATE'); + +INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS,TARGET_ACTION,FLOW_DIRECTIVE) VALUES +('NETWORK','PRECREATED','UPDATE','FAIL'), +('NETWORK','INVENTORIED','UPDATE','FAIL'), +('NETWORK','ASSIGNED','UPDATE','FAIL'), +('NETWORK','CREATED','UPDATE','FAIL'), +('NETWORK','PENDING_CREATE','UPDATE','FAIL'), +('NETWORK','PENDING_DELETE','UPDATE','FAIL'), +('NETWORK','PENDING_ACTIVATION','UPDATE','FAIL'), +('NETWORK','ACTIVE','UPDATE','CONTINUE'); \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.5__PointGrApiDefault_To_UpdateVfModuleVolumeInfraV1.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.5__PointGrApiDefault_To_UpdateVfModuleVolumeInfraV1.sql new file mode 100644 index 0000000000..dbabcb6419 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.5__PointGrApiDefault_To_UpdateVfModuleVolumeInfraV1.sql @@ -0,0 +1,4 @@ +USE catalogdb; + + +UPDATE `catalogdb`.`vnf_components_recipe` SET `ORCHESTRATION_URI`='/mso/async/services/UpdateVfModuleVolumeInfraV1' WHERE `VF_MODULE_MODEL_UUID`='GR-API-DEFAULT' and `VNF_COMPONENT_TYPE`='volumeGroup' and `ACTION`='updateInstance'; diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.6__UpdateNetworkCollectionCatalogDB.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.6__UpdateNetworkCollectionCatalogDB.sql new file mode 100644 index 0000000000..8b66706032 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.6__UpdateNetworkCollectionCatalogDB.sql @@ -0,0 +1,38 @@ +use catalogdb; + +UPDATE building_block_detail SET RESOURCE_TYPE = "NETWORK_COLLECTION" WHERE BUILDING_BLOCK_NAME = "ActivateNetworkCollectionBB"; +UPDATE building_block_detail SET RESOURCE_TYPE = "NETWORK_COLLECTION" WHERE BUILDING_BLOCK_NAME = "CreateNetworkCollectionBB"; +UPDATE building_block_detail SET RESOURCE_TYPE = "NETWORK_COLLECTION" WHERE BUILDING_BLOCK_NAME = "DeleteNetworkCollectionBB"; +UPDATE building_block_detail SET RESOURCE_TYPE = "NETWORK_COLLECTION" WHERE BUILDING_BLOCK_NAME = "DeactivateNetworkCollectionBB"; +UPDATE building_block_detail SET TARGET_ACTION = "DEACTIVATE" WHERE BUILDING_BLOCK_NAME = "DeactivateNetworkCollectionBB"; + +INSERT into orchestration_status_state_transition_directive (RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) values +("NETWORK_COLLECTION", "PRECREATED", "CREATE", "CONTINUE"), +("NETWORK_COLLECTION", "ASSIGNED", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "CREATED", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "ACTIVE", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_CREATE", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_DELETE", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_ACTIVATION", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "PENDING", "CREATE", "FAIL"), +("NETWORK_COLLECTION", "INVENTORIED", "CREATE", "SILENT_SUCCESS"), + +("NETWORK_COLLECTION", "PRECREATED", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "ASSIGNED", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "CREATED", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "ACTIVE", "DELETE", "CONTINUE"), +("NETWORK_COLLECTION", "PENDING_CREATE", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_DELETE", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_ACTIVATION", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "PENDING", "DELETE", "FAIL"), +("NETWORK_COLLECTION", "INVENTORIED", "DELETE", "CONTINUE"), + +("NETWORK_COLLECTION", "PRECREATED", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "ASSIGNED", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "CREATED", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "ACTIVE", "ACTIVE", "SILENT_SUCCESS"), +("NETWORK_COLLECTION", "PENDING_CREATE", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_DELETE", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "PENDING_ACTIVATION", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "PENDING", "ACTIVE", "FAIL"), +("NETWORK_COLLECTION", "INVENTORIED", "ACTIVE", "CONTINUE"); \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.7__FixDeactivateNetworkCollection.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.7__FixDeactivateNetworkCollection.sql new file mode 100644 index 0000000000..872f22fee0 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.7__FixDeactivateNetworkCollection.sql @@ -0,0 +1,5 @@ +use catalogdb; + +UPDATE orchestration_status_state_transition_directive SET TARGET_ACTION = "ACTIVATE" WHERE TARGET_ACTION = "ACTIVE"; + +DELETE FROM building_block_detail WHERE BUILDING_BLOCK_NAME = "DeactivateNetworkCollectionBB"; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.8__UnassignFabricConfigurationData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.8__UnassignFabricConfigurationData.sql new file mode 100644 index 0000000000..29a8c1ed5f --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.8__UnassignFabricConfigurationData.sql @@ -0,0 +1,31 @@ +use catalogdb; + +INSERT INTO building_block_detail (building_block_name, resource_type, target_action) +VALUES +('UnassignFabricConfigurationBB', 'CONFIGURATION', 'UNASSIGN'); + +INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) +VALUES +('CONFIGURATION', 'PRECREATED', 'UNASSIGN', 'SILENT SUCCESS'), +('CONFIGURATION', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'), +('CONFIGURATION', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'), +('CONFIGURATION', 'CREATED', 'UNASSIGN', 'FAIL'), +('CONFIGURATION', 'ACTIVE', 'UNASSIGN', 'FAIL'), +('CONFIGURATION', 'PENDING CREATE', 'UNASSIGN', 'FAIL'), +('CONFIGURATION', 'PENDING DELETE', 'UNASSIGN', 'FAIL'), +('CONFIGURATION', 'PENDING ACTIVATION', 'UNASSIGN', 'FAIL'), +('CONFIGURATION', 'PENDING', 'UNASSIGN', 'FAIL'); + +UPDATE orchestration_flow_reference +SET SEQ_NO = SEQ_NO + 2 WHERE COMPOSITE_ACTION = 'SERVICE-MACRO-DELETE'; + +INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) +VALUES +('Service-Macro-Delete', '1', 'DeactivateFabricConfigurationBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')), +('Service-Macro-Delete', '2', 'UnassignFabricConfigurationBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete')); + +INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY) +VALUES +('UnassignFabricConfigurationBB', '*', '*', '*', '*' , 'Retry'); + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.9__DropCRModelUUID_FK.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.9__DropCRModelUUID_FK.sql new file mode 100644 index 0000000000..d406f8ab4a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V3.9__DropCRModelUUID_FK.sql @@ -0,0 +1,3 @@ +use catalogdb; + +ALTER TABLE instance_group DROP FOREIGN KEY instance_group_ibfk_1; \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/index.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/index.html new file mode 100644 index 0000000000..572e311533 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/index.html @@ -0,0 +1,41 @@ + + + + SO Catalog Database + + + +
+ + + + + + + + + + + + + + + + + +
+ Visit our Swagger UI +
+ CatalogDB Read me +
+ View Current Properties +
+ View Health +
+ View Metrics +
+ H2 Console +
+
+ + \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/index.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/index.html new file mode 100644 index 0000000000..b6ff8f3991 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/index.html @@ -0,0 +1,53 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Introduction

    +
  • +
  • +

    SO API Handler

    +
  • +
  • +

    SO API Handler utilizes RESTful interfaces to interact with consumer applications. The SO interface + is used to orchestrate VNFs, allow for manual task completion, and send vnf replace requests. + It contains both the SOServiceInstantiation API and SOManualTasks API.

    +
  • +
  • +

    SOServiceInstantiation API

    +
  • +
  • +

    The SOServiceInstantiation API handles service instance requests, and supports both macro and aLaCarte + orchestrations. Change management operations, activation and deactivation of service instances, and new + requests for configuration resources are handled by this API. This API is currently + set for version 6 ("v6") while also supporting versions 4 and 5 ("v4", "v5") minus additional "v6" features.

    +
  • +
  • +

    SOManualTasks API

    +
  • +
  • +

    The SOManualTasks API handles queries about open manual tasks. This API also accepts POST requests + containing information about how SO should proceed with handling the open tasks, and resolving the + errors. SOManualTasks API currently supports version 1 ("v1").

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/install.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/install.html new file mode 100644 index 0000000000..297a32074f --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/install.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Install

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/jars.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/jars.html new file mode 100644 index 0000000000..8d5c12bda7 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/jars.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Jars

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/layout.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/layout.html new file mode 100644 index 0000000000..cf47ed6a52 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/layout.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Layout

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/logging.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/logging.html new file mode 100644 index 0000000000..af68c7c634 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/logging.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Logging

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/onaplogo.png b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/onaplogo.png new file mode 100644 index 0000000000..c6f6857a58 Binary files /dev/null and b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/onaplogo.png differ diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/packaging.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/packaging.html new file mode 100644 index 0000000000..a72542c968 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/packaging.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Packaging

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/page.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/page.html new file mode 100644 index 0000000000..baee81bd83 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/page.html @@ -0,0 +1,67 @@ + + + + + + + \ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/readme.css b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/readme.css new file mode 100644 index 0000000000..68963ba3ad --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/readme.css @@ -0,0 +1,114 @@ +html, body{ + margin:0; + padding:0; + height:100%; +} +div#page-wrapper{ + width: 991px; + min-height: 100%; + margin: auto; + border-style: solid; + border-width: thin; + border-color: #d0d6e0; + position: relative; +} +body{ + display:none; +} +nav#header{ + padding: 10px; + width: 972px; + height: 101.8px; + border-bottom: 1px solid #d0d6e0; + text-align: left; +} +nav#header ul{ + padding-left: 0px; + list-style-type: none; +} +nav#header a{ + color: #008080; + text-decoration: none; +} +nav#header a:hover{ + text-decoration: underline; +} +nav#left-col{ + position: absolute; + left: 0; + width: 248px; + padding-bottom: 35px; +} +nav#left-col ul{ + padding-left: 10px; + list-style-type: none; +} +.pages { + color: #008080; + text-decoration: none; + text-align: left; + font-size: 18px; +} +.sub-bullet a{ + text-decoration: none; + text-align: left; + font-size: 14px; + color: black; +} +.sub-bullet a:hover{ + text-decoration: underline; +} +div#right-col{ + padding-left: 150px; + padding-bottom: 35px; + padding-right: 50px; +} +.title{ + color: #008080; + font-size: 24px; + list-style-type: none; +} +.info-title{ + color: black; + font-size: 18px; + list-style-type: none; +} +.info{ + color: grey; + font-size: 14px; + list-style-type: none; +} +.info-list{ + list-style-position:inside; + font-size: 14px; + color: grey; + position: relative; + padding-bottom: 5px; +} +.info-sublist{ + list-style-position:inside; + font-size: 14px; + color: grey; + position: relative; + padding-bottom: 5px; + padding-left: 45px; +} +div#footer-wrapper{ + position: absolute; + bottom: 0; + width: 981px; + height: 35px; + background-color: #008080; + color: white; + font-size:15px; + text-align:right; + padding-right:10px; +} +div#footer-wrapper a{ + color: white; + text-align:right; + text-decoration:none; +} +div#footer-wrapper a:hover{ + text-decoration: underline; +} diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/spring.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/spring.html new file mode 100644 index 0000000000..c6e2b46710 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/spring.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Spring

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/tools.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/tools.html new file mode 100644 index 0000000000..b1813db387 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/readme/tools.html @@ -0,0 +1,34 @@ + + + + + Read Me + + + +
+
+
+
    +
  • +

    Tools

    +
  • +
  • +

    Information Title

    +
  • +
  • +

    Information

    +
  • +
+
+
+ + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-16x16.png b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-16x16.png new file mode 100644 index 0000000000..0f7e13b0d9 Binary files /dev/null and b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-16x16.png differ diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-32x32.png b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-32x32.png new file mode 100644 index 0000000000..b0a3352ffd Binary files /dev/null and b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/favicon-32x32.png differ diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/index.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/index.html new file mode 100644 index 0000000000..13354cd3bb --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/index.html @@ -0,0 +1,95 @@ + + + + + + Swagger UI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/oauth2-redirect.html b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/oauth2-redirect.html new file mode 100644 index 0000000000..eb00dc686a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/oauth2-redirect.html @@ -0,0 +1,60 @@ + + + + + + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui-bundle.js b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui-bundle.js new file mode 100644 index 0000000000..50ac4c2e40 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/static/swagger/swagger-ui-bundle.js @@ -0,0 +1,99 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1139)}([function(e,t,n){"use strict";e.exports=n(86)},function(e,t,n){e.exports=n(923)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(312),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function k(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function w(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(kn&&e[kn]||e[wn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?j():o(e)?e.toSeq():z(e)}function T(e){return null===e||void 0===e?j().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function M(e){return null===e||void 0===e?j():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?j():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function F(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function N(e){this._iterable=e,this.size=e.length||e.size}function R(e){this._iterator=e,this._iteratorCache=[]}function B(e){return!(!e||!e[Sn])}function j(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new R(e).fromEntrySeq():E(e)?new N(e).fromEntrySeq():"object"==typeof e?new F(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new F(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new R(e):E(e)?new N(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?w():k(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):X(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?M(e).map(J).toList():X(e)?T(e).map(J).toMap():e}function X(e){return e&&(e.constructor===Object||void 0===e.constructor)}function K(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&K(i[1],e)&&(n||K(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!K(t,e.get(r,vn)):!K(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Rn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),jn===Bn&&(jn=0,Ln={}),jn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?ke():fe(e)&&!l(e)?e:ke().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return k(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function ke(){return Un||(Un=xe(0))}function we(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):ke()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Te(e,t,r){for(var i=[],a=0;a>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Re(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Be(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s0&&io?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Kn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Kn)return e;s=null}if(l===c)return Kn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<=e.size||t<0)return e.withMutations(function(e){t<0?Ke(e,t).set(0,n):Ke(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Xe(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Ke(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<=1<p?new ze([],r):d;if(d&&h>p&&ahn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<i&&(l=l.removeBefore(r,u,a-c)),l&&ha&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e>>hn<=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return k(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return k(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&B(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&ts)return w();var e=i.next();return r||t===bn?e:t===_n?k(t,u-1,void 0,e):k(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return w();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:k(r,u,l,e):(s=!1,w())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?k(i,l++,void 0,e):k(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:k(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l0}function wt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?w():k(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return B(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?T:s(e)?M:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Tt(e,t){return e>t?1:et?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Tn(t,3432918353),t=Tn(t<<15|t>>>-15,461845907),t=Tn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Tn(t^t>>>16,2246822507),t=Tn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<r?w():k(e,i,n[t?r-i++:i++])})},e(F,T),F.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},F.prototype.has=function(e){return this._object.hasOwnProperty(e)},F.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},F.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?w():k(e,a,n[a])})},F.prototype[fn]=!0,e(N,M),N.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},N.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(w);var i=0;return new x(function(){var t=r.next();return t.done?t:k(e,i++,t.value)})},e(R,M),R.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return k(e,i,r[i++])})};var Cn;e($,M),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return K(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return K(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return K(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?w():k(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Tn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Mn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Fn=0,Nn="__immutablehash__";"function"==typeof Symbol&&(Nn=Symbol(Nn));var Rn=16,Bn=255,jn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return ke().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return we(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return we(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Fe(this,Mt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ke()},pe.prototype.merge=function(){return Te(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Te(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,ke(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Te(this,Me,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Te(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,ke(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[Ne(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?Re(f,p,d,m):je(f,p,m):Be(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f=0&&e>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Xn,Kn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,T),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:k(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,M),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:k(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:k(e,t.value,t.value,t)})},e(at,T),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return k(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Ft(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,ke()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Ft(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Bt,re),Bt.of=function(){return this(arguments)},Bt.fromKeys=function(e){return this(n(e).keySeq())},Bt.prototype.toString=function(){return this.__toString("Set {","}")},Bt.prototype.has=function(e){return this._map.has(e)},Bt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Bt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Bt.prototype.clear=function(){return Lt(this,this._map.clear())},Bt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Xt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Xt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Kt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Xt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Xt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,k(e,n++,t)}return w()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Bt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return K(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return K(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Mt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return K(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j.default.Map();if(!j.default.Map.isMap(e)||!e.size)return j.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=j.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,D.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=j.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){return(0,W.default)((0,z.default)(e))}function k(e){return x(e.replace(/\.[^.\/]*$/,""))}function w(e){return"string"!=typeof e||""===e?"":(0,L.sanitizeUrl)(e)}function E(e){if(!j.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,F.default)(e.get("content")||{}).length>0}),n=e.get("default")||j.default.OrderedMap(),r=(n.get("content")||j.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.errorLog=t.memoize=t.isImmutable=void 0;var S=n(42),C=r(S),A=n(16),D=r(A),O=n(89),T=r(O),M=n(31),P=r(M),I=n(49),F=r(I),N=n(43),R=r(N);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.pascalCase=x,t.pascalCaseFilename=k,t.sanitizeUrl=w,t.getAcceptControllingResponse=E;var B=n(8),j=r(B),L=n(471),q=n(881),z=r(q),U=n(406),W=r(U),V=n(403),H=r(V),G=n(215),J=r(G),X=n(897),K=r(X),Y=n(113),$=r(Y),Z=n(161),Q=n(48),ee=r(Q),te=n(639),ne=r(te),re="default",ie=t.isImmutable=function(e){return j.default.Iterable.isIterable(e)},oe=(t.memoize=H.default,t.errorLog=function(e){return function(){return function(t){return function(n){try{t(n)}catch(t){e().errActions.newThrownErr(t,n)}}}}},t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,F.default)(e).length!==(0,F.default)(t).length||((0,K.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return j.default.Iterable.isIterable(e)?!j.default.is(e,i):("object"!==(void 0===e?"undefined":(0,R.default)(e))||"object"!==(void 0===i?"undefined":(0,R.default)(i)))&&e!==i})||n.some(function(n){return!(0,$.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),ae=t.validateMinimum=function(e,t){if(et)return"Value must be less than MaxLength"},me=t.validateMinLength=function(e,t){if(e.length2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e,s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&j.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof ee.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ve(i,h);x&&r.push(x)}if(p||0===p){var k=de(i,p);k&&r.push(k)}if(f){var w=me(i,f);w&&r.push(w)}if(s||0===s){var E=oe(i,s);E&&r.push(E)}if(u||0===u){var S=ae(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?fe(i):"uuid"===c?he(i):pe(i)))return r;r.push(C)}else if("boolean"===l){var A=ce(i);if(!A)return r;r.push(A)}else if("number"===l){var D=se(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=ue(i);if(!O)return r;r.push(O)}else if("array"===l){var T=void 0;if(!i.count())return r;T=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===T?n=se(e):"integer"===T?n=ue(e):"string"===T&&(n=pe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var M=le(i);if(!M)return r;r.push(M)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Z.memoizedCreateXMLExample)(e,n)}return(0,C.default)((0,Z.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=window.location.search;if(""!=t){var n=t.substr(1).split("&");for(var r in n)r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,J.default)(n,function(n){return(0,$.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,ne.default)(ge(e))}}).call(t,n(50).Buffer)},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ +var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),l=1;l=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?l(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,c)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(455),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=l,t.replaceEntities=p,t.escapeHtml=h},function(e,t,n){var r=n(342)("wks"),i=n(194),o=n(28).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){"use strict";function r(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof b.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function i(e){function t(t,n,r,i,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;l5?l-5:0),p=5;p5?a-5:0),u=5;u key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u5?s-5:0),l=5;l5?l-5:0),p=5;p>",k={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=k},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.get("openapi");return!!t&&t.startsWith("3.0.0")}function o(e){var t=e.get("swagger");return!!t&&t.startsWith("2")}function a(e){return function(t,n){return function(r){if(n&&n.specSelectors&&n.specSelectors.specJson){return i(n.specSelectors.specJson())?c.default.createElement(e,(0,u.default)({},r,n,{Ori:t})):c.default.createElement(t,r)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(20),u=r(s);t.isOAS3=i,t.isSwagger2=o,t.OAS3ComponentWrapFactory=a;var l=n(0),c=r(l)},function(e,t,n){e.exports={default:n(556),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(312),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(27);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++v1)for(var n=1;n0&&(a=this.buffer[u-1],e.call(r,a)<0);)if(u--,this.pointer-u>n/2-1){o=" ... ",u+=5;break}for(l="",i=this.pointer;in/2-1){l=" ... ",i-=5;break}return""+new Array(t).join(" ")+o+this.buffer.slice(u,i)+l+"\n"+new Array(t+this.pointer-u+o.length).join(" ")+"^"},t.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},t}(),this.YAMLError=function(e){function n(e){this.message=e,n.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(n,e),n.prototype.toString=function(){return this.message},n}(Error),this.MarkedYAMLError=function(e){function n(e,t,r,i,o){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=i,this.note=o,n.__super__.constructor.call(this)}return t(n,e),n.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},n}(this.YAMLError)}).call(this)},function(e,t,n){e.exports={default:n(555),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(531),o=r(i),a=n(530),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){e.exports=!n(52)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e,t,n){return n?[e,t]:e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var i=n(12),o=n(65),a=n(29),s=(n(9),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;ls&&(n=s-u),l=n;l>=0;l--){for(var p=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&o)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return O(r)}function O(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function B(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||j(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||j(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function z(e){if(e=U(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function J(e){return Y.toByteArray(z(e))}function X(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e){return e!==e}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var Y=n(534),$=n(707),Z=n(366);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,u=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),$.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),$.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),$.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),$.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):B(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):B(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):B(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):B(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},o.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&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a1?t-1:0),i=1;i2?n-2:0),o=2;o=n?e:e.length+1===n?""+t+e:""+new Array(n-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,n(18))},function(e,t,n){var r=n(101);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){"use strict";var r=n(668),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:(e=Object(e),l&&l in e?o(e):a(e))}var i=n(76),o=n(837),a=n(866),s="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(795),o=n(838);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(10),i=(n(7),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t){e.exports={}},function(e,t,n){var r=n(172),i=n(169);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(169);e.exports=function(e){return Object(r(e))}},function(e,t){var n=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(132),i=n(341);e.exports=n(99)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(351)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:r(e)?[]:[e]}function a(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,n){"use strict";var r=n(12),i=n(441),o=n(1026),a=n(1027),s=n(87),u=n(1028),l=n(1029),c=n(1030),p=n(1034),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v=function(e){return e},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i.Component,PureComponent:i.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:c,createFactory:h,createMixin:v,DOM:a,version:l,__spread:m};e.exports=g},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function i(e){return void 0!==e.key}var o=n(12),a=n(47),s=(n(9),n(445),Object.prototype.hasOwnProperty),u=n(443),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,i,o,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:o};return s};c.createElement=function(e,t,n){var o,u={},p=null,f=null;if(null!=t){r(t)&&(f=t.ref),i(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(o in t)s.call(t,o)&&!l.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),m=0;m1){for(var g=Array(v),y=0;y=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(527),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(589);for(var r=n(22),i=n(54),o=n(68),a=n(19)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u0&&void 0!==arguments[0]?arguments[0]:{};return{type:v,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=r,t.newThrownErrBatch=i,t.newSpecErr=o,t.newSpecErrBatch=a,t.newAuthErr=s,t.clear=u;var l=n(248),c=function(e){return e&&e.__esModule?e:{default:e}}(l),p=t.NEW_THROWN_ERR="err_new_thrown_err",f=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",h=t.NEW_SPEC_ERR="err_new_spec_err",d=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",m=t.NEW_AUTH_ERR="err_new_auth_err",v=t.CLEAR="err_clear"},function(e,t,n){var r=n(51),i=n(319),o=n(317),a=n(33),s=n(126),u=n(184),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t){e.exports=!0},function(e,t,n){var r=n(127)("meta"),i=n(27),o=n(53),a=n(37).f,s=0,u=Object.isExtensible||function(){return!0},l=!n(52)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!o(e,r)&&c(e),e},d=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(180),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(128);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(28),i=n(71),o=n(72),a=n(103),s=n(130),u=function(e,t,n){var l,c,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,_=d?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});d&&(n=t);for(l in n)c=!h&&y&&void 0!==y[l],p=(c?y:n)[l],f=g&&c?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(59),i=n(609),o=n(627),a=Object.defineProperty;t.f=n(99)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r,i=n(352),o=n(355),a=n(672),s=n(677);r=e.exports=function(e,t){var n,r,a,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=a=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),a=s.call(e,"w")),l={value:t,configurable:n,enumerable:r,writable:a},u?i(o(u),l):l},r.gs=function(e,t,n){var r,u,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(r=!0,u=!1):(r=s.call(e,"c"),u=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:u},l?i(o(l),c):c}},function(e,t,n){"use strict";e.exports=n(669)("forEach")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,u=0;u0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(75);e.exports=r.DEFAULT=new r({include:[n(111)],explicit:[n(748),n(747),n(746)]})},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e]/;e.exports=i},function(e,t,n){"use strict";var r,i=n(23),o=n(225),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(233),l=u(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos1&&void 0!==arguments[1])||arguments[1];return e=(0,s.normalizeArray)(e),{type:p,payload:{thing:e,shown:t}}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,s.normalizeArray)(e),{type:c,payload:{thing:e,mode:t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=r,t.updateFilter=i,t.show=o,t.changeMode=a;var s=n(11),u=t.UPDATE_LAYOUT="layout_update_layout",l=t.UPDATE_FILTER="layout_update_filter",c=t.UPDATE_MODE="layout_update_mode",p=t.SHOW="layout_show"},function(e,t,n){"use strict";function r(e){return{type:u,payload:e}}function i(e){var t=e.value,n=e.pathMethod;return{type:l,payload:{value:t,pathMethod:n}}}function o(e){var t=e.value,n=e.pathMethod;return{type:c,payload:{value:t,pathMethod:n}}}function a(e){var t=e.value,n=e.path,r=e.method;return{type:p,payload:{value:t,path:n,method:r}}}function s(e){var t=e.server,n=e.key,r=e.val;return{type:f,payload:{server:t,key:n,val:r}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=r,t.setRequestBodyValue=i,t.setRequestContentType=o,t.setResponseContentType=a,t.setServerVariableValue=s;var u=t.UPDATE_SELECTED_SERVER="oas3_set_servers",l=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",c=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",p=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",f=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=h(e,t);if(n)return(0,s.default)(n,{declaration:!0,indent:"\t"})}Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=i;var o=n(11),a=n(1125),s=r(a),u=n(910),l=r(u),c={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},p=function(e){e=(0,o.objectify)(e);var t=e,n=t.type,r=t.format,i=c[n+"_"+r]||c[n];return(0,o.isFunc)(i)?i(e):"Unknown Type: "+e.type},f=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.example,s=r.properties,u=r.additionalProperties,l=r.items,c=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==a)return a;if(!i)if(s)i="object";else{if(!l)return;i="array"}if("object"===i){var h=(0,o.objectify)(s),d={};for(var m in h)h[m].readOnly&&!c||h[m].writeOnly&&!f||(d[m]=e(h[m],n));if(!0===u)d.additionalProp1={};else if(u)for(var v=(0,o.objectify)(u),g=e(v,n),y=1;y<4;y++)d["additionalProp"+y]=g;return d}return"array"===i?[e(l,n)]:t.enum?t.default?t.default:(0,o.normalizeArray)(t.enum)[0]:"file"!==i?p(t):void 0},h=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.properties,s=r.additionalProperties,u=r.items,l=r.example,c=n.includeReadOnly,f=n.includeWriteOnly,h=r.default,d={},m={},v=t.xml,g=v.name,y=v.prefix,_=v.namespace,b=r.enum,x=void 0,k=void 0;if(!i)if(a||s)i="object";else{if(!u)return;i="array"}if(g=g||"notagname",x=(y?y+":":"")+g,_){m[y?"xmlns:"+y:"xmlns"]=_}if("array"===i&&u){if(u.xml=u.xml||v||{},u.xml.name=u.xml.name||v.name,v.wrapped)return d[x]=[],Array.isArray(l)?l.forEach(function(t){u.example=t,d[x].push(e(u,n))}):Array.isArray(h)?h.forEach(function(t){u.default=t,d[x].push(e(u,n))}):d[x]=[e(u,n)],m&&d[x].push({_attr:m}),d;var w=[];return Array.isArray(l)?(l.forEach(function(t){u.example=t,w.push(e(u,n))}),w):Array.isArray(h)?(h.forEach(function(t){u.default=t,w.push(e(u,n))}),w):e(u,n)}if("object"===i){var E=(0,o.objectify)(a);d[x]=[],l=l||{};for(var S in E)if((!E[S].readOnly||c)&&(!E[S].writeOnly||f))if(E[S].xml=E[S].xml||{},E[S].xml.attribute){var C=Array.isArray(E[S].enum)&&E[S].enum[0],A=E[S].example,D=E[S].default;m[E[S].xml.name||S]=void 0!==A&&A||void 0!==l[S]&&l[S]||void 0!==D&&D||C||p(E[S])}else{E[S].xml.name=E[S].xml.name||S,E[S].example=void 0!==E[S].example?E[S].example:l[S];var O=e(E[S]);Array.isArray(O)?d[x]=d[x].concat(O):d[x].push(O)}return!0===s?d[x].push({additionalProp:"Anything can be here"}):s&&d[x].push({additionalProp:p(s)}),m&&d[x].push({_attr:m}),d}return k=void 0!==l?l:void 0!==h?h:Array.isArray(b)?b[0]:p(t),d[x]=m?[{_attr:m},k]:k,d});t.memoizedCreateXMLExample=(0,l.default)(i),t.memoizedSampleFromSchema=(0,l.default)(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return e instanceof Error?{type:T,error:!0,payload:e}:"string"==typeof e?{type:T,payload:e.replace(/\t/g," ")||""}:{type:T,payload:""}}function o(e){return{type:W,payload:e}}function a(e){return{type:M,payload:e}}function s(e){if(!e||"object"!==(void 0===e?"undefined":(0,k.default)(e)))throw new Error("updateJson must only accept a simple JSON object");return{type:P,payload:e}}function u(e,t,n,r,i){return{type:I,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:i}}}function l(e){return{type:z,payload:{pathMethod:e}}}function c(e,t){return{type:U,payload:{path:e,value:t,key:"consumes_value"}}}function p(e,t){return{type:U,payload:{path:e,value:t,key:"produces_value"}}}function f(e,t){return{type:L,payload:{path:e,method:t}}}function h(e,t){return{type:q,payload:{path:e,method:t}}}function d(e,t,n){return{type:V,payload:{scheme:e,path:t,method:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.formatIntoYaml=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_VALUE=t.ClEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var m=n(20),v=r(m),g=n(90),y=r(g),_=n(31),b=r(_),x=n(43),k=r(x);t.updateSpec=i,t.updateResolved=o,t.updateUrl=a,t.updateJsonSpec=s,t.changeParam=u,t.clearValidateParams=l,t.changeConsumesValue=c,t.changeProducesValue=p,t.clearResponse=f,t.clearRequest=h,t.setScheme=d;var w=n(203),E=r(w),S=n(1115),C=r(S),A=n(248),D=r(A),O=n(11),T=t.UPDATE_SPEC="spec_update_spec",M=t.UPDATE_URL="spec_update_url",P=t.UPDATE_JSON="spec_update_json",I=t.UPDATE_PARAM="spec_update_param",F=t.VALIDATE_PARAMS="spec_validate_param",N=t.SET_RESPONSE="spec_set_response",R=t.SET_REQUEST="spec_set_request",B=t.SET_MUTATED_REQUEST="spec_set_mutated_request",j=t.LOG_REQUEST="spec_log_request",L=t.CLEAR_RESPONSE="spec_clear_response",q=t.CLEAR_REQUEST="spec_clear_request",z=t.ClEAR_VALIDATE_PARAMS="spec_clear_validate_param",U=t.UPDATE_OPERATION_VALUE="spec_update_operation_value",W=t.UPDATE_RESOLVED="spec_update_resolved",V=t.SET_SCHEME="set_scheme",H=(t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,i=t.errActions,o=r.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=E.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return n.updateJsonSpec(a)}},t.resolveSpec=function(e,t){return function(n){var r=n.specActions,i=n.specSelectors,o=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,l=a.AST,c=n.getConfigs,p=c(),f=p.modelPropertyMacro,h=p.parameterMacro,d=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:d,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(o.clear({type:"thrown"}),n.length>0){var i=n.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return r.updateResolved(t)})}},t.formatIntoYaml=function(){return function(e){var t=e.specActions,n=e.specSelectors,r=n.specStr,i=t.updateSpec;try{var o=E.default.safeDump(E.default.safeLoad(r()),{indent:2});i(o)}catch(e){i(e)}}},t.validateParams=function(e,t){return{type:F,payload:{pathMethod:e,isOAS3:t}}},t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:N}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:R}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:B}},t.logRequest=function(e){return{payload:e,type:j}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,i=t.specSelectors,o=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,l=e.operation,c=o(),p=c.requestInterceptor,f=c.responseInterceptor,h=l.toJS();if(e.contextUrl=(0,C.default)(i.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),i.isOAS3()){e.server=a.selectedServer(),e.serverVariables=a.serverVariables(e.server).toJS(),e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var d=a.requestBodyValue(s,u);(0,O.isJSONObject)(d)?e.requestBody=JSON.parse(d):e.requestBody=d}var m=(0,b.default)({},e);m=n.buildRequest(m),r.setRequest(e.pathName,e.method,m);var v=function(t){var n=p.apply(this,[t]),i=(0,b.default)({},n);return r.setMutatedRequest(e.pathName,e.method,i),n};e.requestInterceptor=v,e.responseInterceptor=f;var g=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-g,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,D.default)(t)})})}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=(0,y.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,o=e.specSelectors,a=e.specActions,s=o.spec().toJS(),u=o.operationScheme(t,n),l=o.contentTypeValues([t,n]).toJS(),c=l.requestContentType,p=l.responseContentType,f=/xml/i.test(c),h=o.parameterValues([t,n],f).toJS();return a.executeRequest((0,v.default)({fetch:i,spec:s,pathName:t,method:n,parameters:h,requestContentType:c,scheme:u,responseContentType:p},r))}});t.execute=H},function(e,t,n){"use strict";var r=n(11),i=n(1136);i.keys().forEach(function(t){if("./index.js"!==t){var n=i(t);e.exports[(0,r.pascalCaseFilename)(t)]=n.default?n.default:n}})},function(e,t,n){"use strict";function r(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t){var n=Object.prototype.toString;e.exports=function(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!==e?"nan":e&&1===e.nodeType?"element":typeof(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(51),i=n(172),o=n(70),a=n(126),s=n(569);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=o(t),y=i(g),_=r(s,d,3),b=a(y.length),x=0,k=n?h(t,b):u?h(t,0):void 0;b>x;x++)if((f||x in y)&&(m=y[x],v=_(m,x,g),e))if(n)k[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:k.push(m)}else if(c)return!1;return p?-1:l||c?c:k}}},function(e,t,n){var r=n(93),i=n(19)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(27),i=n(22).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(93);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(92);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(33),i=n(578),o=n(171),a=n(178)("IE_PROTO"),s=function(){},u=function(){var e,t=n(170)("iframe"),r=o.length;for(t.style.display="none",n(315).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("