diff options
92 files changed, 2756 insertions, 649 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql new file mode 100644 index 0000000000..30b5010c7c --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql @@ -0,0 +1,47 @@ +INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) +VALUES + +('CONFIGURATION', 'ACTIVATED', 'UNASSIGN', 'FAIL'), +('CONFIGURATION', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'), +('CONFIGURATION', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), +('CONFIGURATION', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'), + +('NETWORK', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'), +('NETWORK', 'ACTIVATED', 'UNASSIGN', 'FAIL'), +('NETWORK', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), +('NETWORK', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'), +('NETWORK', 'ACTIVATED', 'CREATE', 'SILENT_SUCCESS'), +('NETWORK', 'ACTIVATED', 'DELETE', 'FAIL'), +('NETWORK', 'ACTIVATED', 'UPDATE', 'CONTINUE'), +('NETWORK_COLLECTION', 'ACTIVATED', 'CREATE', 'FAIL'), +('NETWORK_COLLECTION', 'ACTIVATED', 'DELETE', 'CONTINUE'), +('NETWORK_COLLECTION', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), + +('NO_VALIDATE', 'ACTIVATED', 'CUSTOM', 'CONTINUE'), + +('SERVICE', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'), +('SERVICE', 'ACTIVATED', 'UNASSIGN', 'FAIL'), +('SERVICE', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), +('SERVICE', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'), +('SERVICE', 'ACTIVATED', 'CHANGE_MODEL', 'CONTINUE'), + +('VF_MODULE', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'), +('VF_MODULE', 'ACTIVATED', 'UNASSIGN', 'FAIL'), +('VF_MODULE', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'), +('VF_MODULE', 'ACTIVATED', 'CHANGE_MODEL', 'CONTINUE'), +('VF_MODULE', 'ACTIVATED', 'CREATE', 'SILENT_SUCCESS'), +('VF_MODULE', 'ACTIVATED', 'DELETE', 'FAIL'), + +('VNF', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'), +('VNF', 'ACTIVATED', 'UNASSIGN', 'FAIL'), +('VNF', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), +('VNF', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'), +('VNF', 'ACTIVATED', 'CHANGE_MODEL', 'CONTINUE'), + +('VOLUME_GROUP', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ACTIVATED', 'UNASSIGN', 'FAIL'), +('VOLUME_GROUP', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'), +('VOLUME_GROUP', 'ACTIVATED', 'CREATE', 'SILENT_SUCCESS'), +('VOLUME_GROUP', 'ACTIVATED', 'DELETE', 'FAIL');
\ No newline at end of file diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java index 8edce124ec..493ac4a54f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java @@ -22,19 +22,17 @@ package org.onap.so.adapters.audit; import java.util.Optional; -import org.camunda.bpm.client.task.ExternalTask; -import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.objects.audit.AAIObjectAudit; import org.onap.so.objects.audit.AAIObjectAuditList; +import org.onap.so.utils.ExternalTaskUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @Component -public abstract class AbstractAuditService { +public abstract class AbstractAuditService extends ExternalTaskUtils { private static final Logger logger = LoggerFactory.getLogger(AbstractAuditService.class); @@ -82,22 +80,4 @@ public abstract class AbstractAuditService { } } - protected String[] getRetrySequence() { - return env.getProperty("mso.workflow.topics.retrySequence", String[].class); - } - - protected void setupMDC(ExternalTask externalTask) { - logger.info(ONAPLogConstants.Markers.ENTRY, "Entering"); - String msoRequestId = externalTask.getVariable("mso-request-id"); - if (msoRequestId != null && !msoRequestId.isEmpty()) { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId); - } - MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName()); - } - - protected long calculateRetryDelay(int currentRetries) { - int retrySequence = getRetrySequence().length - currentRetries; - long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier", "6000")); - return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier; - } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java index 1e5b6de857..d03c86ac30 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java @@ -34,7 +34,6 @@ import org.onap.so.objects.audit.AAIObjectAuditList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @Component @@ -45,9 +44,6 @@ public class AuditCreateStackService extends AbstractAuditService { @Autowired public HeatStackAudit heatStackAudit; - @Autowired - public Environment environment; - protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { setupMDC(externalTask); AuditInventory auditInventory = externalTask.getVariable("auditInventory"); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java index 6a42456715..fb7e925d88 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java @@ -20,13 +20,9 @@ package org.onap.so.adapters.audit; -import java.security.GeneralSecurityException; import javax.annotation.PostConstruct; import org.camunda.bpm.client.ExternalTaskClient; -import org.camunda.bpm.client.backoff.ExponentialBackoffStrategy; -import org.camunda.bpm.client.interceptor.ClientRequestInterceptor; -import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider; -import org.onap.so.utils.CryptoUtils; +import org.onap.so.utils.ExternalTaskServiceUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -56,10 +52,13 @@ public class AuditStackService { @Autowired private AuditQueryStackService auditQueryStack; + @Autowired + private ExternalTaskServiceUtils externalTaskServiceUtils; + @PostConstruct - public void auditAddAAIInventory() { - for (int i = 0; i < getMaxClients(); i++) { - ExternalTaskClient client = createExternalTaskClient(); + public void auditAddAAIInventory() throws Exception { + for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) { + ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient(); client.subscribe("InventoryAddAudit") .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME))) .handler(auditCreateStack::executeExternalTask).open(); @@ -67,9 +66,9 @@ public class AuditStackService { } @PostConstruct - public void auditDeleteAAIInventory() { - for (int i = 0; i < getMaxClients(); i++) { - ExternalTaskClient client = createExternalTaskClient(); + public void auditDeleteAAIInventory() throws Exception { + for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) { + ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient(); client.subscribe("InventoryDeleteAudit") .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME))) .handler(auditDeleteStack::executeExternalTask).open(); @@ -77,35 +76,13 @@ public class AuditStackService { } @PostConstruct - public void auditQueryInventory() { - for (int i = 0; i < getMaxClients(); i++) { - ExternalTaskClient client = createExternalTaskClient(); + public void auditQueryInventory() throws Exception { + for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) { + ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient(); client.subscribe("InventoryQueryAudit") .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME))) .handler(auditQueryStack::executeExternalTask).open(); } } - protected ExternalTaskClient createExternalTaskClient() { - ClientRequestInterceptor interceptor = createClientRequestInterceptor(); - return ExternalTaskClient.create().baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1) - .addInterceptor(interceptor).asyncResponseTimeout(120000) - .backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build(); - } - - protected ClientRequestInterceptor createClientRequestInterceptor() { - String auth = ""; - try { - auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey")); - } catch (IllegalStateException | GeneralSecurityException e) { - logger.error("Error Decrypting Password", e); - } - return new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth); - } - - protected int getMaxClients() { - return Integer.parseInt(env.getProperty("workflow.topics.maxClients", DEFAULT_MAX_CLIENTS_FOR_TOPIC)); - } - - } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java index 14d83b3b06..35008b6120 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java @@ -84,7 +84,7 @@ public class AuditVServer extends AbstractAudit { try { logger.debug("Vserver to Audit: {}", objectMapper.getMapper().writeValueAsString(vserver)); } catch (JsonProcessingException e) { - logger.error("Json parse exception: {}", e.getMessage()); + logger.error("Json parse exception: ", e); } }); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java index 49a9e7e171..c1cc7428ee 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java @@ -20,13 +20,9 @@ package org.onap.so.adapters.inventory.create; -import java.security.GeneralSecurityException; import javax.annotation.PostConstruct; import org.camunda.bpm.client.ExternalTaskClient; -import org.camunda.bpm.client.backoff.ExponentialBackoffStrategy; -import org.camunda.bpm.client.interceptor.ClientRequestInterceptor; -import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider; -import org.onap.so.utils.CryptoUtils; +import org.onap.so.utils.ExternalTaskServiceUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -46,19 +42,13 @@ public class CreateInventoryService { @Autowired private CreateInventoryTask createInventory; + @Autowired + private ExternalTaskServiceUtils externalTaskServiceUtils; + @PostConstruct - public void auditAAIInventory() { - String auth = ""; - try { - auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey")); - } catch (IllegalStateException | GeneralSecurityException e) { - logger.error("Error Decrypting Password", e); - } - ClientRequestInterceptor interceptor = - new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth); - ExternalTaskClient client = ExternalTaskClient.create() - .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor) - .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build(); + public void auditAAIInventory() throws Exception { + + ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient(); client.subscribe("InventoryCreate") .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000"))) .handler(createInventory::executeExternalTask).open(); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java index a6c61704ad..29d0ef633f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java @@ -27,15 +27,14 @@ import org.camunda.bpm.client.task.ExternalTaskService; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider; import org.onap.so.objects.audit.AAIObjectAuditList; +import org.onap.so.utils.ExternalTaskUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @Component -public class CreateInventoryTask { +public class CreateInventoryTask extends ExternalTaskUtils { private static final String UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI = "Unable to write all inventory to A&AI"; @@ -46,9 +45,6 @@ public class CreateInventoryTask { @Autowired CreateAAIInventory createInventory; - @Autowired - public Environment env; - protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { setupMDC(externalTask); boolean success = true; @@ -107,25 +103,5 @@ public class CreateInventoryTask { } } - private void setupMDC(ExternalTask externalTask) { - try { - logger.info(ONAPLogConstants.Markers.ENTRY, "Entering"); - MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName()); - String msoRequestId = externalTask.getVariable("mso-request-id"); - if (msoRequestId != null && !msoRequestId.isEmpty()) - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId); - } catch (Exception e) { - logger.error("Error in setting up MDC", e); - } - } - - protected long calculateRetryDelay(int currentRetries) { - int retrySequence = getRetrySequence().length - currentRetries; - long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier", "6000")); - return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier; - } - public String[] getRetrySequence() { - return env.getProperty("mso.workflow.topics.retrySequence", String[].class); - } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index afc227faf0..013c7f8a84 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -91,6 +91,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork"; private static final String NEUTRON_MODE = "NEUTRON"; private static final String CLOUD_OWNER = "CloudOwner"; + private static final String LOG_DEBUG_MSG = "Got Network definition from Catalog: {}"; private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterImpl.class); @@ -292,7 +293,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.INTERNAL); } - logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString()); + logger.debug("Got HEAT Template from DB: {}", heatTemplate); // "Fix" the template if it has CR/LF (getting this from Oracle) String template = heatTemplate.getHeatTemplate(); @@ -656,7 +657,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.INTERNAL); } - logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString()); + logger.debug("Got HEAT Template from DB: {}", heatTemplate); // "Fix" the template if it has CR/LF (getting this from Oracle) String template = heatTemplate.getHeatTemplate(); @@ -798,12 +799,11 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } if (networkCust != null) { - logger.debug("Got Network Customization definition from Catalog: {}", networkCust.toString()); + logger.debug("Got Network Customization definition from Catalog: {}", networkCust); networkResource = networkCust.getNetworkResource(); } else if (collectionNetworkCust != null) { - logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}", - collectionNetworkCust.toString()); + logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}", collectionNetworkCust); networkResource = collectionNetworkCust.getNetworkResource(); } if (networkResource == null) { @@ -814,7 +814,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.USERDATA); } - logger.debug("Got Network definition from Catalog: {}", networkResource.toString()); + logger.debug(LOG_DEBUG_MSG, networkResource); String mode = networkResource.getOrchestrationMode(); NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType()); @@ -1045,7 +1045,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } String mode = ""; if (networkResource != null) { - logger.debug("Got Network definition from Catalog: {}", networkResource.toString()); + logger.debug(LOG_DEBUG_MSG, networkResource); mode = networkResource.getOrchestrationMode(); } @@ -1132,7 +1132,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { String mode = ""; if (networkResource != null) { - logger.debug("Got Network definition from Catalog: {}", networkResource.toString()); + logger.debug(LOG_DEBUG_MSG, networkResource); mode = networkResource.getOrchestrationMode(); } @@ -1388,9 +1388,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Resource Property List<ContrailSubnet> cslist = new ArrayList<>(); for (Subnet subnet : subnets) { - logger.debug("Input Subnet:{}", subnet.toString()); + logger.debug("Input Subnet:{}", subnet); ContrailSubnet cs = new ContrailSubnetMapper(subnet).map(); - logger.debug("Contrail Subnet:{}", cs.toString()); + logger.debug("Contrail Subnet:{}", cs); cslist.add(cs); } @@ -1523,18 +1523,17 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { JsonNode rootNode = mapper.readTree(jStr); if (rootNode != null) { for (JsonNode sNode : rootNode.path("ipam_subnets")) { - logger.debug("Output Subnet Node {}", sNode.toString()); + logger.debug("Output Subnet Node {}", sNode); String name = sNode.path("subnet_name").textValue(); String uuid = sNode.path("subnet_uuid").textValue(); String aaiId = name; // default // try to find aaiId for name in input subnetList if (subnets != null) { for (Subnet subnet : subnets) { - if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) { - if (subnet.getSubnetName().equals(name)) { - aaiId = subnet.getSubnetId(); - break; - } + if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName()) + && subnet.getSubnetName().equals(name)) { + aaiId = subnet.getSubnetId(); + break; } } } @@ -1549,7 +1548,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { ErrorCode.DataError.getValue(), e); } - logger.debug("Return sMap {}", sMap.toString()); + logger.debug("Return sMap {}", sMap); return sMap; } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java index 3432e4a8b6..2109fb289f 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java @@ -170,47 +170,6 @@ public class AuditStackServiceDataTest extends AuditCreateStackService { } @Test - public void retry_sequence_calculation_Test() { - long firstRetry = auditStackService.calculateRetryDelay(8); - assertEquals(6000L, firstRetry); - long secondRetry = auditStackService.calculateRetryDelay(7); - assertEquals(6000L, secondRetry); - long thirdRetry = auditStackService.calculateRetryDelay(6); - assertEquals(12000L, thirdRetry); - long fourthRetry = auditStackService.calculateRetryDelay(5); - assertEquals(18000L, fourthRetry); - long fifthRetry = auditStackService.calculateRetryDelay(4); - assertEquals(30000L, fifthRetry); - long sixRetry = auditStackService.calculateRetryDelay(3); - assertEquals(48000L, sixRetry); - long seventhRetry = auditStackService.calculateRetryDelay(2); - assertEquals(78000L, seventhRetry); - long eigthRetry = auditStackService.calculateRetryDelay(1); - assertEquals(120000L, eigthRetry); - } - - @Test - public void retry_sequence_Test() { - long firstRetry = auditStackService.calculateRetryDelay(8); - assertEquals(6000L, firstRetry); - long secondRetry = auditStackService.calculateRetryDelay(7); - assertEquals(6000L, secondRetry); - long thirdRetry = auditStackService.calculateRetryDelay(6); - assertEquals(12000L, thirdRetry); - long fourthRetry = auditStackService.calculateRetryDelay(5); - assertEquals(18000L, fourthRetry); - long fifthRetry = auditStackService.calculateRetryDelay(4); - assertEquals(30000L, fifthRetry); - long sixRetry = auditStackService.calculateRetryDelay(3); - assertEquals(48000L, sixRetry); - long seventhRetry = auditStackService.calculateRetryDelay(2); - assertEquals(78000L, seventhRetry); - long eigthRetry = auditStackService.calculateRetryDelay(1); - assertEquals(120000L, eigthRetry); - } - - - @Test public void determineAuditResult_Test() throws Exception { boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess); assertEquals(false, actual); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java deleted file mode 100644 index c9aef950f7..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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.audit; - -import static com.shazam.shazamcrest.MatcherAssert.assertThat; -import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import org.camunda.bpm.client.ExternalTaskClient; -import org.camunda.bpm.client.interceptor.ClientRequestInterceptor; -import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.Spy; -import org.mockito.junit.MockitoJUnitRunner; -import org.onap.so.utils.CryptoUtils; -import org.springframework.core.env.Environment; - -@RunWith(MockitoJUnitRunner.class) -public class AuditStackServiceTest { - - @Spy - @InjectMocks - AuditStackService auditStackService; - - @Mock - Environment mockEnvironment; - - - @Before - public void before() { - Mockito.doReturn("5").when(mockEnvironment).getProperty("workflow.topics.maxClients", "10"); - Mockito.doReturn("6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436") - .when(mockEnvironment).getRequiredProperty("mso.auth"); - Mockito.doReturn("07a7159d3bf51a0e53be7a8f89699be7").when(mockEnvironment).getRequiredProperty("mso.msoKey"); - Mockito.doReturn("something").when(mockEnvironment).getRequiredProperty("mso.config.cadi.aafId"); - Mockito.doReturn("host.com").when(mockEnvironment).getRequiredProperty("mso.workflow.endpoint"); - } - - @Test - public void testGetMaxClients() throws Exception { - int actual = auditStackService.getMaxClients(); - assertEquals(5, actual); - } - - @Test - public void testCreateClientRequestInterceptor() throws Exception { - String auth = CryptoUtils.decrypt( - "6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436", - "07a7159d3bf51a0e53be7a8f89699be7"); - ClientRequestInterceptor expected = new BasicAuthProvider("something", auth); - ClientRequestInterceptor actual = auditStackService.createClientRequestInterceptor(); - assertThat(actual, sameBeanAs(expected)); - - } - - @Test - public void testCreateExternalTaskClient() throws Exception { - String auth = CryptoUtils.decrypt( - "6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436", - "07a7159d3bf51a0e53be7a8f89699be7"); - ClientRequestInterceptor inter = new BasicAuthProvider("something", auth); - Mockito.doReturn(inter).when(auditStackService).createClientRequestInterceptor(); - ExternalTaskClient actual = auditStackService.createExternalTaskClient(); - assertNotNull(actual); - Mockito.verify(auditStackService, Mockito.times(1)).createClientRequestInterceptor(); - - } -} diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql new file mode 100644 index 0000000000..eac9a65f65 --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql @@ -0,0 +1,12 @@ +use requestdb; + +DROP INDEX `infra_active_requests__aic_cloud_region_idx` on `infra_active_requests`; + +ALTER TABLE + `infra_active_requests` CHANGE AIC_CLOUD_REGION CLOUD_REGION varchar(50) DEFAULT NULL; + +ALTER TABLE + `archived_infra_requests` CHANGE AIC_CLOUD_REGION CLOUD_REGION VARCHAR(50) NULL DEFAULT NULL; + +ALTER TABLE `infra_active_requests` + ADD INDEX IF NOT EXISTS `infra_active_requests__cloud_region_idx` (`CLOUD_REGION` ASC); diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql new file mode 100644 index 0000000000..2f7438c1d3 --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql @@ -0,0 +1,21 @@ +ALTER TABLE `requestdb`.`infra_active_requests` +ADD INDEX IF NOT EXISTS `infra_active_requests__service_instance_id_idx` (`SERVICE_INSTANCE_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__service_instance_name_idx` (`SERVICE_INSTANCE_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__vnf_id_idx` (`VNF_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__vnf_name_name_idx` (`VNF_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__vf_module_id_idx` (`VF_MODULE_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__vf_module_name_idx` (`VF_MODULE_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__volume_group_id_idx` (`VOLUME_GROUP_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__volume_group_name_idx` (`VOLUME_GROUP_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__network_id_idx` (`NETWORK_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__network_name_idx` (`NETWORK_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__configuration_id_idx` (`CONFIGURATION_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__configuration_name_idx` (`CONFIGURATION_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__instance_group_id_idx` (`INSTANCE_GROUP_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__instance_group_name_idx` (`INSTANCE_GROUP_NAME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__aic_cloud_region_idx` (`AIC_CLOUD_REGION` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__tenant_id_idx` (`TENANT_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__request_scope_idx` (`REQUEST_SCOPE` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__requestor_id_idx` (`REQUESTOR_ID` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__start_time_idx` (`START_TIME` ASC), +ADD INDEX IF NOT EXISTS `infra_active_requests__end_time_idx` (`END_TIME` ASC);
\ No newline at end of file diff --git a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 9c2ea6d3bf..65fac11d41 100644 --- a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -4,7 +4,7 @@ insert into operation_status(service_id, operation_id, service_name, user_id, re ('serviceid', 'operationid', 'servicename', 'userid', 'result', 'operationcontent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10'); -insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, aic_cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values +insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values ('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java index 0fc94c8bd6..7f1c1968c1 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java @@ -20,6 +20,8 @@ package org.onap.so.asdc.activity; +import java.net.HttpURLConnection; +import java.net.URL; import java.util.ArrayList; import java.util.List; import org.onap.so.logger.LoggingAnchor; @@ -27,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import org.apache.http.HttpStatus; import org.onap.so.asdc.activity.beans.ActivitySpec; import org.onap.so.asdc.activity.beans.Input; import org.onap.so.asdc.activity.beans.Output; @@ -59,6 +62,11 @@ public class DeployActivitySpecs { String hostname = env.getProperty(SDC_ENDPOINT); logger.debug("{} {}", "SDC ActivitySpec endpoint: ", hostname); if (hostname == null || hostname.isEmpty()) { + logger.warn("The hostname for SDC activities deployment is not configured in SO"); + return; + } + if (!checkHttpOk(hostname)) { + logger.warn("The sdc end point is not alive"); return; } List<org.onap.so.db.catalog.beans.ActivitySpec> activitySpecsFromCatalog = activitySpecRepository.findAll(); @@ -135,4 +143,22 @@ public class DeployActivitySpecs { activitySpec.setOutputs(outputs); return; } + + public boolean checkHttpOk(String host) { + URL url = null; + boolean isOk = false; + + int responseCode = 0; + try { + url = new URL(host); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + responseCode = connection.getResponseCode(); + } catch (Exception e) { + logger.warn("Exception on connecting to SDC WFD endpoint: " + e.getMessage()); + } + if (responseCode == HttpStatus.SC_OK) { + isOk = true; + } + return isOk; + } } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index da989b0155..e8e068a71a 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -26,6 +26,7 @@ package org.onap.so.asdc.installer.heat; import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.HashMap; @@ -437,13 +438,15 @@ public class ToscaResourceInstaller { List<IEntityDetails> vfEntityList = getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false); + List<IEntityDetails> arEntityDetails = new ArrayList<IEntityDetails>(); + for (IEntityDetails vfEntityDetails : vfEntityList) { Metadata metadata = vfEntityDetails.getMetadata(); String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY); if (ALLOTTED_RESOURCE.equalsIgnoreCase(category)) { - continue; + arEntityDetails.add(vfEntityDetails); } processVfModules(vfEntityDetails, vfNodeTemplatesList.get(0), toscaResourceStruct, vfResourceStructure, @@ -451,8 +454,7 @@ public class ToscaResourceInstaller { } processResourceSequence(toscaResourceStruct, service); - List<NodeTemplate> allottedResourceList = toscaResourceStruct.getSdcCsarHelper().getAllottedResources(); - processAllottedResources(toscaResourceStruct, service, allottedResourceList); + processAllottedResources(arEntityDetails, toscaResourceStruct, service); processNetworks(toscaResourceStruct, service); // process Network Collections processNetworkCollections(toscaResourceStruct, service); @@ -579,7 +581,8 @@ public class ToscaResourceInstaller { String outInput; String defaultValue = null; if (value instanceof Map) { - outInput = ((LinkedHashMap) value).values().toArray()[0].toString(); + Collection values = ((LinkedHashMap) value).values(); + outInput = (values.size() > 0) ? values.toArray()[0].toString() : ""; } else if (value instanceof GetInput) { String inputName = ((GetInput) value).getInputName(); Optional<Input> inputOptional = @@ -656,7 +659,10 @@ public class ToscaResourceInstaller { NetworkResourceCustomization networkCustomization = createNetwork(vlEntity, toscaResourceStruct, heatTemplate, tempNetworkLookUp.getAicVersionMax(), tempNetworkLookUp.getAicVersionMin(), service); - service.getNetworkCustomizations().add(networkCustomization); + // only insert unique entries + if (!service.getNetworkCustomizations().contains(networkCustomization)) { + service.getNetworkCustomizations().add(networkCustomization); + } } else { throw new ArtifactInstallerException("No HeatTemplate found for artifactUUID: " + tempNetworkLookUp.getHeatTemplateArtifactUuid()); @@ -675,14 +681,31 @@ public class ToscaResourceInstaller { } } - protected void processAllottedResources(ToscaResourceStructure toscaResourceStruct, Service service, - List<NodeTemplate> allottedResourceList) throws ArtifactInstallerException { - if (allottedResourceList != null) { - for (NodeTemplate allottedNode : allottedResourceList) { + protected void processAllottedResources(List<IEntityDetails> arEntityDetails, + ToscaResourceStructure toscaResourceStruct, Service service) throws ArtifactInstallerException { + + List<IEntityDetails> pnfAREntityList = getEntityDetails(toscaResourceStruct, + EntityQuery.newBuilder(SdcTypes.PNF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false); + + for (IEntityDetails pnfEntity : pnfAREntityList) { + + Metadata metadata = pnfEntity.getMetadata(); + String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY); + if (ALLOTTED_RESOURCE.equalsIgnoreCase(category)) { + arEntityDetails.add(pnfEntity); + } + + } + + if (arEntityDetails != null) { + for (IEntityDetails arEntity : arEntityDetails) { AllottedResourceCustomization allottedResource = - createAllottedResource(allottedNode, toscaResourceStruct, service); - allottedResource.setResourceInput( - getResourceInput(toscaResourceStruct, allottedResource.getModelCustomizationUUID())); + createAllottedResource(arEntity, toscaResourceStruct, service); + String resourceInput = + getResourceInput(toscaResourceStruct, allottedResource.getModelCustomizationUUID()); + if (!"{}".equals(resourceInput)) { + allottedResource.setResourceInput(resourceInput); + } service.getAllottedCustomizations().add(allottedResource); } } @@ -818,13 +841,13 @@ public class ToscaResourceInstaller { protected void processNetworkCollections(ToscaResourceStructure toscaResourceStruct, Service service) { - List<NodeTemplate> networkCollectionList = - toscaResourceStruct.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CR); + List<IEntityDetails> crEntityList = getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.CR), + TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false); - if (networkCollectionList != null) { - for (NodeTemplate crNode : networkCollectionList) { + if (crEntityList != null) { + for (IEntityDetails ncEntity : crEntityList) { - createNetworkCollection(crNode, toscaResourceStruct, service); + createNetworkCollection(ncEntity, toscaResourceStruct, service); collectionRepo.saveAndFlush(toscaResourceStruct.getCatalogCollectionResource()); List<NetworkInstanceGroup> networkInstanceGroupList = @@ -1655,7 +1678,7 @@ public class ToscaResourceInstaller { return networkResource; } - protected CollectionNetworkResourceCustomization createNetworkCollection(NodeTemplate networkNodeTemplate, + protected CollectionNetworkResourceCustomization createNetworkCollection(IEntityDetails cnrEntity, ToscaResourceStructure toscaResourceStructure, Service service) { CollectionNetworkResourceCustomization collectionNetworkResourceCustomization = @@ -1664,33 +1687,26 @@ public class ToscaResourceInstaller { // **** Build Object to populate Collection_Resource table CollectionResource collectionResource = new CollectionResource(); + collectionResource.setModelName(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); collectionResource - .setModelName(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); - collectionResource.setModelInvariantUUID( - networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - collectionResource - .setModelUUID(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); - collectionResource - .setModelVersion(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); - collectionResource - .setDescription(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); - collectionResource.setToscaNodeType(networkNodeTemplate.getType()); + .setModelInvariantUUID(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); + collectionResource.setModelUUID(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); + collectionResource.setModelVersion(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); + collectionResource.setDescription(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + collectionResource.setToscaNodeType(cnrEntity.getToscaType()); toscaResourceStructure.setCatalogCollectionResource(collectionResource); // **** Build object to populate Collection_Resource_Customization table NetworkCollectionResourceCustomization ncfc = new NetworkCollectionResourceCustomization(); - ncfc.setFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, - "cr_function")); - ncfc.setRole(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, - "cr_role")); - ncfc.setType(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, - "cr_type")); + ncfc.setFunction(getLeafPropertyValue(cnrEntity, "cr_function")); + ncfc.setRole(getLeafPropertyValue(cnrEntity, "cr_role")); + ncfc.setType(getLeafPropertyValue(cnrEntity, "cr_type")); - ncfc.setModelInstanceName(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); + ncfc.setModelInstanceName(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); ncfc.setModelCustomizationUUID( - networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); + cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); Set<CollectionNetworkResourceCustomization> networkResourceCustomizationSet = new HashSet<>(); networkResourceCustomizationSet.add(collectionNetworkResourceCustomization); @@ -1701,25 +1717,28 @@ public class ToscaResourceInstaller { toscaResourceStructure.setCatalogCollectionResourceCustomization(ncfc); // *** Build object to populate the Instance_Group table - List<Group> groupList = - toscaResourceStructure.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType( - networkNodeTemplate, "org.openecomp.groups.NetworkCollection"); + List<IEntityDetails> ncEntityList = + getEntityDetails(toscaResourceStructure, + EntityQuery.newBuilder("org.openecomp.groups.NetworkCollection"), + TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID( + cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)), + false); List<NetworkInstanceGroup> networkInstanceGroupList = new ArrayList<>(); List<CollectionResourceInstanceGroupCustomization> collectionResourceInstanceGroupCustomizationList = new ArrayList<>(); - for (Group group : groupList) { + for (IEntityDetails ncGroupEntity : ncEntityList) { NetworkInstanceGroup networkInstanceGroup = new NetworkInstanceGroup(); - Metadata instanceMetadata = group.getMetadata(); + Metadata instanceMetadata = ncGroupEntity.getMetadata(); networkInstanceGroup.setModelName(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); networkInstanceGroup .setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); networkInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); networkInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); - networkInstanceGroup.setToscaNodeType(group.getType()); + networkInstanceGroup.setToscaNodeType(ncGroupEntity.getToscaType()); networkInstanceGroup.setRole(SubType.SUB_INTERFACE.toString()); // Set // Role networkInstanceGroup.setType(InstanceGroupType.L3_NETWORK); // Set @@ -1733,27 +1752,26 @@ public class ToscaResourceInstaller { crInstanceGroupCustomization.setInstanceGroup(networkInstanceGroup); crInstanceGroupCustomization.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); crInstanceGroupCustomization.setModelCustomizationUUID( - networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); + cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); // Loop through the template policy to find the subinterface_network_quantity property name. Then extract // the value for it. - List<Policy> policyList = - toscaResourceStructure.getSdcCsarHelper().getPoliciesOfOriginOfNodeTemplateByToscaPolicyType( - networkNodeTemplate, "org.openecomp.policies.scaling.Fixed"); + List<IEntityDetails> policyEntityList = getEntityDetails(toscaResourceStructure, + EntityQuery.newBuilder("org.openecomp.policies.scaling.Fixed"), + TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), true); - if (policyList != null) { - for (Policy policy : policyList) { - for (String policyNetworkCollection : policy.getTargets()) { + if (policyEntityList != null) { + for (IEntityDetails policyEntity : policyEntityList) { + for (String policyNetworkCollection : policyEntity.getTargets()) { - if (policyNetworkCollection.equalsIgnoreCase(group.getName())) { + if (policyNetworkCollection.equalsIgnoreCase(ncGroupEntity.getName())) { - Map<String, Object> propMap = policy.getPolicyProperties(); + Map<String, Property> propMap = policyEntity.getProperties(); if (propMap.get("quantity") != null) { - String quantity = toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(networkNodeTemplate, - getPropertyInput(propMap.get("quantity").toString())); + String quantity = getLeafPropertyValue(cnrEntity, + getPropertyInput(propMap.get("quantity").toString())); if (quantity != null) { crInstanceGroupCustomization @@ -1768,13 +1786,12 @@ public class ToscaResourceInstaller { } crInstanceGroupCustomization.setDescription( - toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, - instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME) - + "_network_collection_description")); - crInstanceGroupCustomization.setFunction( - toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, - instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME) - + "_network_collection_function")); + getLeafPropertyValue(cnrEntity, instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME) + + "_network_collection_description")); + + crInstanceGroupCustomization.setFunction(getLeafPropertyValue(cnrEntity, + instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME) + "_network_collection_function")); + crInstanceGroupCustomization.setCollectionResourceCust(ncfc); collectionResourceInstanceGroupCustomizationList.add(crInstanceGroupCustomization); @@ -1786,18 +1803,21 @@ public class ToscaResourceInstaller { toscaResourceStructure.setCatalogNetworkInstanceGroup(networkInstanceGroupList); - List<NodeTemplate> vlNodeList = toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplateBySdcType(networkNodeTemplate, SdcTypes.VL); + List<IEntityDetails> networkEntityList = + getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VL), + TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID( + cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)), + false); List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizationList = new ArrayList<>(); // *****Build object to populate the NetworkResource table NetworkResource networkResource = new NetworkResource(); - for (NodeTemplate vlNodeTemplate : vlNodeList) { + for (IEntityDetails networkEntity : networkEntityList) { - String providerNetwork = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue( - vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK); + String providerNetwork = getLeafPropertyValue(networkEntity, + SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK); if ("true".equalsIgnoreCase(providerNetwork)) { networkResource.setNeutronNetworkType(PROVIDER); @@ -1805,22 +1825,20 @@ public class ToscaResourceInstaller { networkResource.setNeutronNetworkType(BASIC); } - networkResource - .setModelName(vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); + networkResource.setModelName(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); networkResource.setModelInvariantUUID( - vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - networkResource - .setModelUUID(vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); + networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); + networkResource.setModelUUID(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); networkResource - .setModelVersion(vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); + .setModelVersion(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); networkResource.setAicVersionMax( - vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)); + networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)); TempNetworkHeatTemplateLookup tempNetworkLookUp = tempNetworkLookupRepo.findFirstBynetworkResourceModelName( - vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); + networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); if (tempNetworkLookUp != null) { @@ -1832,29 +1850,28 @@ public class ToscaResourceInstaller { } - networkResource.setToscaNodeType(vlNodeTemplate.getType()); + networkResource.setToscaNodeType(networkEntity.getToscaType()); networkResource.setDescription( - vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); networkResource.setOrchestrationMode(HEAT); // Build object to populate the // Collection_Network_Resource_Customization table - for (NodeTemplate memberNode : group.getMemberNodes()) { - collectionNetworkResourceCustomization.setModelInstanceName(memberNode.getName()); + for (IEntityDetails networkMemberEntity : ncGroupEntity.getMemberNodes()) { + collectionNetworkResourceCustomization.setModelInstanceName(networkMemberEntity.getName()); } collectionNetworkResourceCustomization.setModelCustomizationUUID( - vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); + networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); collectionNetworkResourceCustomization.setNetworkTechnology( - toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNodeTemplate, - SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); - collectionNetworkResourceCustomization.setNetworkType(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); - collectionNetworkResourceCustomization.setNetworkRole(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); - collectionNetworkResourceCustomization.setNetworkScope(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); + getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); + collectionNetworkResourceCustomization.setNetworkType( + getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); + collectionNetworkResourceCustomization.setNetworkRole( + getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); + collectionNetworkResourceCustomization.setNetworkScope( + getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); collectionNetworkResourceCustomization.setInstanceGroup(networkInstanceGroup); collectionNetworkResourceCustomization.setNetworkResource(networkResource); collectionNetworkResourceCustomization.setNetworkResourceCustomization(ncfc); @@ -2499,7 +2516,6 @@ public class ToscaResourceInstaller { // setting resource input for vnf customization vnfResourceCustomization.setResourceInput( getResourceInput(toscaResourceStructure, vnfResourceCustomization.getModelCustomizationUUID())); - service.getVnfCustomizations().add(vnfResourceCustomization); } return vnfResourceCustomization; @@ -2599,21 +2615,21 @@ public class ToscaResourceInstaller { return vnfResource; } - protected AllottedResourceCustomization createAllottedResource(NodeTemplate nodeTemplate, + protected AllottedResourceCustomization createAllottedResource(IEntityDetails arEntity, ToscaResourceStructure toscaResourceStructure, Service service) { AllottedResourceCustomization allottedResourceCustomization = allottedCustomizationRepo.findOneByModelCustomizationUUID( - nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); + arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); if (allottedResourceCustomization == null) { AllottedResource allottedResource = findExistingAllottedResource(service, - nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); + arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); if (allottedResource == null) - allottedResource = createAR(nodeTemplate); + allottedResource = createAR(arEntity); toscaResourceStructure.setAllottedResource(allottedResource); - allottedResourceCustomization = createAllottedResourceCustomization(nodeTemplate, toscaResourceStructure); + allottedResourceCustomization = createAllottedResourceCustomization(arEntity, toscaResourceStructure); allottedResourceCustomization.setAllottedResource(allottedResource); allottedResource.getAllotedResourceCustomization().add(allottedResourceCustomization); } @@ -2634,73 +2650,81 @@ public class ToscaResourceInstaller { return allottedResource; } - protected AllottedResourceCustomization createAllottedResourceCustomization(NodeTemplate nodeTemplate, + protected AllottedResourceCustomization createAllottedResourceCustomization(IEntityDetails arEntity, ToscaResourceStructure toscaResourceStructure) { AllottedResourceCustomization allottedResourceCustomization = new AllottedResourceCustomization(); allottedResourceCustomization.setModelCustomizationUUID( - testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID))); - allottedResourceCustomization.setModelInstanceName(nodeTemplate.getName()); + testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID))); + allottedResourceCustomization.setModelInstanceName(arEntity.getName()); + allottedResourceCustomization + .setNfFunction(getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); + allottedResourceCustomization.setNfNamingCode(getLeafPropertyValue(arEntity, "nf_naming_code")); + allottedResourceCustomization.setNfRole(getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE)); + allottedResourceCustomization.setNfType(getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); - allottedResourceCustomization.setNfFunction(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION))); - allottedResourceCustomization.setNfNamingCode(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(nodeTemplate, "nf_naming_code"))); - allottedResourceCustomization.setNfRole(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE))); - allottedResourceCustomization.setNfType(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE))); + EntityQuery entityQuery = EntityQuery.newBuilder(SdcTypes.VFC).build(); - List<NodeTemplate> vfcNodes = toscaResourceStructure.getSdcCsarHelper() - .getVfcListByVf(allottedResourceCustomization.getModelCustomizationUUID()); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF) + .customizationUUID(allottedResourceCustomization.getModelCustomizationUUID()).build(); - if (vfcNodes != null) { - for (NodeTemplate vfcNode : vfcNodes) { + List<IEntityDetails> vfcEntities = + toscaResourceStructure.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, false); - allottedResourceCustomization.setProvidingServiceModelUUID(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfcNode, "providing_service_uuid")); + + if (vfcEntities != null) { + for (IEntityDetails vfcEntity : vfcEntities) { + + allottedResourceCustomization + .setProvidingServiceModelUUID(getLeafPropertyValue(vfcEntity, "providing_service_uuid")); + allottedResourceCustomization.setProvidingServiceModelInvariantUUID( + getLeafPropertyValue(vfcEntity, "providing_service_invariant_uuid")); allottedResourceCustomization - .setProvidingServiceModelInvariantUUID(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfcNode, "providing_service_invariant_uuid")); - allottedResourceCustomization.setProvidingServiceModelName(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfcNode, "providing_service_name")); + .setProvidingServiceModelName(getLeafPropertyValue(vfcEntity, "providing_service_name")); } } + Map<String, CapabilityAssignment> capAssignmentList = arEntity.getCapabilities(); - CapabilityAssignments arCustomizationCapability = - toscaResourceStructure.getSdcCsarHelper().getCapabilitiesOf(nodeTemplate); + if (capAssignmentList != null) { - if (arCustomizationCapability != null) { - CapabilityAssignment capAssign = arCustomizationCapability.getCapabilityByName(SCALABLE); + for (Map.Entry<String, CapabilityAssignment> entry : capAssignmentList.entrySet()) { + CapabilityAssignment arCapability = entry.getValue(); + + if (arCapability != null) { + + String capabilityName = arCapability.getName(); + + if (capabilityName.equals(SCALABLE)) { + + allottedResourceCustomization + .setMinInstances(Integer.getInteger(getCapabilityLeafPropertyValue(arCapability, + SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); + allottedResourceCustomization + .setMinInstances(Integer.getInteger(getCapabilityLeafPropertyValue(arCapability, + SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); + + } + } - if (capAssign != null) { - allottedResourceCustomization.setMinInstances( - Integer.getInteger(toscaResourceStructure.getSdcCsarHelper().getCapabilityPropertyLeafValue( - capAssign, SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); - allottedResourceCustomization.setMaxInstances( - Integer.getInteger(toscaResourceStructure.getSdcCsarHelper().getCapabilityPropertyLeafValue( - capAssign, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); } } + return allottedResourceCustomization; } - protected AllottedResource createAR(NodeTemplate nodeTemplate) { + protected AllottedResource createAR(IEntityDetails arEntity) { AllottedResource allottedResource = new AllottedResource(); - allottedResource - .setModelUUID(testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID))); + allottedResource.setModelUUID(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID))); allottedResource.setModelInvariantUUID( - testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID))); - allottedResource - .setModelName(testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); + testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID))); + allottedResource.setModelName(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); allottedResource - .setModelVersion(testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION))); - allottedResource.setToscaNodeType(testNull(nodeTemplate.getType())); - allottedResource.setSubcategory( - testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY))); + .setModelVersion(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION))); + allottedResource.setToscaNodeType(testNull(arEntity.getToscaType())); allottedResource - .setDescription(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + .setSubcategory(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY))); + allottedResource.setDescription(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); return allottedResource; } @@ -2792,14 +2816,26 @@ public class ToscaResourceInstaller { return null; } + protected String getCapabilityLeafPropertyValue(CapabilityAssignment capAssign, String propName) { + + Property leafProperty = capAssign.getProperties().get(propName); + + if (leafProperty != null && leafProperty.getValue() != null) { + return leafProperty.getValue().toString(); + } + + return null; + } + protected String getPropertyInput(String propertyName) { String inputName = new String(); if (propertyName != null) { int getInputIndex = propertyName.indexOf("{get_input="); + int getClosingIndex = propertyName.indexOf("}"); if (getInputIndex > -1) { - inputName = propertyName.substring(getInputIndex + 11, propertyName.length() - 1); + inputName = propertyName.substring(getInputIndex + 11, getClosingIndex); } } @@ -2815,10 +2851,16 @@ public class ToscaResourceInstaller { Service existingService = services.get(0); List<VnfResourceCustomization> existingVnfCustomizations = existingService.getVnfCustomizations(); if (existingService != null) { - service.getVnfCustomizations().addAll(existingVnfCustomizations); + // it is duplicating entries, so added a check + for (VnfResourceCustomization existingVnfResourceCustomization : existingVnfCustomizations) { + if (!service.getVnfCustomizations().contains(existingVnfResourceCustomization)) { + service.getVnfCustomizations().add(existingVnfResourceCustomization); + } + } } } service.getVnfCustomizations().add(vnfResourceCustomization); + } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java index a154734690..4b069e6ac7 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java @@ -724,6 +724,9 @@ public class ASDCNotificationLogging { buffer.append("Model Subcategory:"); buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)); buffer.append(System.lineSeparator()); + buffer.append("Model Category:"); + buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + buffer.append(System.lineSeparator()); buffer.append("Model Description:"); buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); buffer.append(System.lineSeparator()); diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java index 81977da278..b41fbaf658 100644 --- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java +++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java @@ -22,7 +22,10 @@ package org.onap.asdc.activity; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.put; +import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; +import static com.github.tomakehurst.wiremock.client.WireMock.verify; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; import org.junit.Test; @@ -73,4 +76,32 @@ public class DeployActivitySpecsITTest extends BaseTest { deployActivitySpecs.deployActivities(); assertTrue(activitySpecCreateResponse.getId().equals("testActivityId")); } + + @Test + public void deployActivitySpecsIT_SDCEndpointDown_Test() throws Exception { + ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse(); + activitySpecCreateResponse.setId("testActivityId"); + HttpHeaders headers = new HttpHeaders(); + headers.set("Accept", MediaType.APPLICATION_JSON); + headers.set("Content-Type", MediaType.APPLICATION_JSON); + + ObjectMapper mapper = new ObjectMapper(); + String body = mapper.writeValueAsString(activitySpecCreateResponse); + + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.OK.value()).withBody(body))); + + when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://localhost:8090"); + + String urlPath = "/v1.0/activity-spec/testActivityId/versions/latest/actions"; + + wireMockServer.stubFor( + put(urlPathMatching(urlPath)).willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.OK.value()))); + + deployActivitySpecs.deployActivities(); + verify(0, putRequestedFor(urlEqualTo(urlPath))); + } + } diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java index aae5e5dc53..7a876a67a2 100644 --- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java +++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java @@ -30,6 +30,7 @@ import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; +import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; import org.onap.so.asdc.activity.ActivitySpecsActions; import org.onap.so.asdc.activity.DeployActivitySpecs; @@ -54,6 +55,7 @@ public class DeployActivitySpecsTest { protected ActivitySpecsActions activitySpecsActions; @InjectMocks + @Spy private DeployActivitySpecs deployActivitySpecs; @Test @@ -68,7 +70,8 @@ public class DeployActivitySpecsTest { List<org.onap.so.db.catalog.beans.ActivitySpec> catalogActivitySpecList = new ArrayList<org.onap.so.db.catalog.beans.ActivitySpec>(); catalogActivitySpecList.add(catalogActivitySpec); - when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("testEndpoint"); + when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://testEndpoint"); + doReturn(true).when(deployActivitySpecs).checkHttpOk("http://testEndpoint"); when(activitySpecRepository.findAll()).thenReturn(catalogActivitySpecList); doReturn("testActivityId").when(activitySpecsActions).createActivitySpec(Mockito.any(), Mockito.any()); doReturn(true).when(activitySpecsActions).certifyActivitySpec(Mockito.any(), Mockito.any()); diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java index 2a4b3aa6fb..e1b124775b 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java @@ -51,11 +51,13 @@ import org.onap.so.asdc.client.test.emulators.DistributionClientEmulator; import org.onap.so.asdc.client.test.emulators.NotificationDataImpl; import org.onap.so.db.catalog.beans.AllottedResource; import org.onap.so.db.catalog.beans.AllottedResourceCustomization; +import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; import org.onap.so.db.catalog.beans.NetworkResource; import org.onap.so.db.catalog.beans.NetworkResourceCustomization; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.ToscaCsar; import org.onap.so.db.catalog.beans.Workflow; +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.NetworkResourceRepository; import org.onap.so.db.catalog.data.repository.ServiceRepository; @@ -77,6 +79,9 @@ public class ASDCRestInterfaceTest extends BaseTest { private AllottedResourceRepository allottedRepo; @Autowired + private AllottedResourceCustomizationRepository allottedCustomRepo; + + @Autowired private ServiceRepository serviceRepo; @Autowired @@ -148,7 +153,6 @@ public class ASDCRestInterfaceTest extends BaseTest { AllottedResourceCustomization arCustomization = new AllottedResourceCustomization(); arCustomization.setModelCustomizationUUID("f62bb612-c5d4-4406-865c-0abec30631ba"); arCustomization.setModelInstanceName("rege1802pnf 0"); - arCustomization.setResourceInput("{}"); arCustomizationSet.add(arCustomization); arCustomization.setAllottedResource(expectedService); @@ -319,6 +323,30 @@ public class ASDCRestInterfaceTest extends BaseTest { assertEquals("CCVPNService", service.get().getModelName()); } + @Test + public void test_PublicNS_Distribution() throws Exception { + wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json"))); + + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value()))); + + String resourceLocation = "src/test/resources/resource-examples/public-ns/"; + ObjectMapper mapper = new ObjectMapper(); + NotificationDataImpl request = mapper.readValue(new File(resourceLocation + "demo-public-ns-notification.json"), + NotificationDataImpl.class); + headers.add("resource-location", resourceLocation); + HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers); + ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + HttpMethod.POST, entity, String.class); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + + Optional<Service> service = serviceRepo.findById("da28696e-d4c9-4df4-9f91-465c6c09a81e"); + assertTrue(service.isPresent()); + assertEquals("PublicNS", service.get().getModelName()); + } + protected String createURLWithPort(String uri) { return "http://localhost:" + port + uri; } diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json b/asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json new file mode 100644 index 0000000000..f829bf0246 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json @@ -0,0 +1,173 @@ +{ + "distributionID": "2d6c5aa8-b644-4f30-a632-5577801ef954", + "serviceName": "PublicNS", + "serviceVersion": "1.0", + "serviceUUID": "da28696e-d4c9-4df4-9f91-465c6c09a81e", + "serviceDescription": "PUblic NS", + "serviceInvariantUUID": "e907ce73-7e4d-4bf8-b94a-21bd1a7c7592", + "resources": [ + { + "resourceInstanceName": "vCPE 0", + "resourceName": "vCPE", + "resourceVersion": "1.0", + "resoucreType": "VF", + "resourceUUID": "a67562cf-1bf3-4450-8b69-3bb1cff43089", + "resourceInvariantUUID": "e0b3088d-9ca8-482a-aa5a-a1e6906b2d22", + "resourceCustomizationUUID": "ae70c293-8db3-40cd-8cd0-30cde194bea5", + "category": "Generic", + "subcategory": "Infrastructure", + "artifacts": [ + { + "artifactName": "vf-license-model.xml", + "artifactType": "VF_LICENSE", + "artifactURL": "/vcpe0/vf-license-model.xml", + "artifactChecksum": "YjYyYWNiMzUxM2YzMWYxYWVhN2Y5MTM3N2E5YzNhNmU\u003d", + "artifactDescription": "VF license file", + "artifactTimeout": 120, + "artifactUUID": "5c29e823-7114-4988-824f-f670ba9d7b21", + "artifactVersion": "1" + }, + { + "artifactName": "vcpe0_modules.json", + "artifactType": "VF_MODULES_METADATA", + "artifactURL": "/vcpe0/vcpe0_modules.json", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "128e4e77-21a4-49c3-ac7a-7ca3b187bddc", + "artifactVersion": "1" + }, + { + "artifactName": "ar1000v.yaml", + "artifactType": "HEAT", + "artifactURL": "/vcpe0/ar1000v.yaml", + "artifactChecksum": "NWU2NGUwNmNkMGEzYjAxMTAyODkzNTc5YzFmZDBmMzM\u003d", + "artifactDescription": "created from csar", + "artifactTimeout": 120, + "artifactUUID": "12dcc618-20f2-4f15-ab00-c549b96b3910", + "artifactVersion": "2" + }, + { + "artifactName": "vendor-license-model.xml", + "artifactType": "VENDOR_LICENSE", + "artifactURL": "/vcpe0/vendor-license-model.xml", + "artifactChecksum": "OTRkOTY3YjdjM2ZlNDM3NjNlZjBjODU4YTJmNGZhNGE\u003d", + "artifactDescription": " Vendor license file", + "artifactTimeout": 120, + "artifactUUID": "74c4d1bd-1779-421f-8c9d-774ac4567031", + "artifactVersion": "1" + }, + { + "artifactName": "ar1000v.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/vcpe0/ar1000v.env", + "artifactChecksum": "YzI4MjlkODk4YzcyOTgzZTg2YjAyM2ZiNWU1N2FmMjI\u003d", + "artifactDescription": "Auto-generated HEAT Environment deployment artifact", + "artifactTimeout": 120, + "artifactUUID": "5821b043-ba50-49ef-b739-61b0896050f2", + "artifactVersion": "2", + "generatedFromUUID": "12dcc618-20f2-4f15-ab00-c549b96b3910" + } + ] + }, + { + "resourceInstanceName": "vGW 0", + "resourceName": "vGW", + "resourceVersion": "1.0", + "resoucreType": "VF", + "resourceUUID": "cd82e255-56cf-4644-858e-36cfc45ef754", + "resourceInvariantUUID": "52905e03-0632-43f9-93f2-2ab7d959f633", + "resourceCustomizationUUID": "fd8595de-1081-4e39-a401-24ffebaa9ed8", + "category": "Generic", + "subcategory": "Infrastructure", + "artifacts": [ + { + "artifactName": "vf-license-model.xml", + "artifactType": "VF_LICENSE", + "artifactURL": "/vgw0/vf-license-model.xml", + "artifactChecksum": "YTdlMDhmYjMzODg5NmI3ODgwNjA0MmUyOWU2N2I2MGM\u003d", + "artifactDescription": "VF license file", + "artifactTimeout": 120, + "artifactUUID": "f2db3ba5-190f-4214-90fd-93407caf10c1", + "artifactVersion": "1" + }, + { + "artifactName": "vgw0_modules.json", + "artifactType": "VF_MODULES_METADATA", + "artifactURL": "/vgw0/vgw0_modules.json", + "artifactChecksum": "OTQwY2ZlZThjMjNlYjAyNzU4NDUyZDVhY2VjNTIwZTk\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "8730baa0-1b8c-4ac3-bc5c-d49c5b88f111", + "artifactVersion": "1" + }, + { + "artifactName": "gateway.yaml", + "artifactType": "HEAT", + "artifactURL": "/vgw0/gateway.yaml", + "artifactChecksum": "NGNiMGRjMWViNGRkMGQzM2ZjNDNjMjQ5OGMwMjI2MjM\u003d", + "artifactDescription": "created from csar", + "artifactTimeout": 120, + "artifactUUID": "60d55796-212c-4c66-8af5-63964d636ae4", + "artifactVersion": "2" + }, + { + "artifactName": "vendor-license-model.xml", + "artifactType": "VENDOR_LICENSE", + "artifactURL": "/vgw0/vendor-license-model.xml", + "artifactChecksum": "OTRkOTY3YjdjM2ZlNDM3NjNlZjBjODU4YTJmNGZhNGE\u003d", + "artifactDescription": " Vendor license file", + "artifactTimeout": 120, + "artifactUUID": "019bdcbf-03fc-4ec2-8d39-c09f808722e9", + "artifactVersion": "1" + }, + { + "artifactName": "gateway.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/vgw0/gateway.env", + "artifactChecksum": "Y2Y4ZDgzMDg3NDBiMDhkODZiMmE1MGUyYjU2ZGFlZDU\u003d", + "artifactDescription": "Auto-generated HEAT Environment deployment artifact", + "artifactTimeout": 120, + "artifactUUID": "9df0452f-826c-4287-9a2d-ca0095339866", + "artifactVersion": "2", + "generatedFromUUID": "60d55796-212c-4c66-8af5-63964d636ae4" + } + ] + }, + { + "resourceInstanceName": "Generic NeutronNet 0", + "resourceName": "Generic NeutronNet", + "resourceVersion": "1.0", + "resoucreType": "VL", + "resourceUUID": "4069be99-5d9a-427b-a427-04fe16ccbf38", + "resourceInvariantUUID": "f3ed1133-c1bb-4735-82d4-8e041265fad6", + "resourceCustomizationUUID": "c8a1a81d-d836-4f33-9d0e-91e9417f812a", + "category": "Generic", + "subcategory": "Network Elements", + "artifacts": [] + } + ], + "serviceArtifacts": [ + { + "artifactName": "service-Publicns-template.yml", + "artifactType": "TOSCA_TEMPLATE", + "artifactURL": "/service-Publicns-template.yml", + "artifactChecksum": "NTUzMDU5YzM3MTk4OGNiNjQ2OGRlMWY2YjU3MjE2YjM\u003d", + "artifactDescription": "TOSCA representation of the asset", + "artifactTimeout": 0, + "artifactUUID": "2617d0ca-54f0-4222-b659-c12e292d94dd", + "artifactVersion": "1" + }, + { + "artifactName": "service-Publicns-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "/service-Publicns-csar.csar", + "artifactChecksum": "ZTRhOGI0M2UxN2ZhYjQ0ODI5ZDZhZTExZTFkMGU3N2Y\u003d", + "artifactDescription": "TOSCA definition package of the asset", + "artifactTimeout": 0, + "artifactUUID": "26a323ff-b97b-4b86-96b1-25a80c0876e5", + "artifactVersion": "1" + } + ], + "workloadContext": "Production" +} diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csar b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csar Binary files differnew file mode 100644 index 0000000000..d5ea949cdc --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csar diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml new file mode 100644 index 0000000000..2e6f29360f --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml @@ -0,0 +1,1186 @@ +tosca_definitions_version: tosca_simple_yaml_1_1 +metadata: + invariantUUID: e907ce73-7e4d-4bf8-b94a-21bd1a7c7592 + UUID: da28696e-d4c9-4df4-9f91-465c6c09a81e + name: PublicNS + description: PUblic NS + type: Service + category: E2E Service + serviceType: '' + serviceRole: '' + instantiationType: A-la-carte + serviceEcompNaming: true + ecompGeneratedNaming: true + namingPolicy: '' + environmentContext: General_Revenue-Bearing +imports: +- nodes: + file: nodes.yml +- datatypes: + file: data.yml +- capabilities: + file: capabilities.yml +- relationships: + file: relationships.yml +- groups: + file: groups.yml +- policies: + file: policies.yml +- annotations: + file: annotations.yml +- service-PublicNS-interface: + file: service-Publicns-template-interface.yml +- resource-vCPE: + file: resource-Vcpe-template.yml +- resource-vCPE-interface: + file: resource-Vcpe-template-interface.yml +- resource-vGW: + file: resource-Vgw-template.yml +- resource-vGW-interface: + file: resource-Vgw-template-interface.yml +- resource-Generic NeutronNet: + file: resource-GenericNeutronnet-template.yml +topology_template: + node_templates: + vCPE 0: + type: org.openecomp.resource.vf.Vcpe + metadata: + invariantUUID: e0b3088d-9ca8-482a-aa5a-a1e6906b2d22 + UUID: 32edc5e6-34f7-4d62-92f8-c38817280eb9 + customizationUUID: ae70c293-8db3-40cd-8cd0-30cde194bea5 + version: '1.0' + name: vCPE + description: vCPE + type: VF + category: Generic + subcategory: Infrastructure + resourceVendor: huawei + resourceVendorRelease: '1.0' + resourceVendorModelNumber: '' + properties: + vf_module_id: vCPEAR1000V + private_subnet_lan_id: 265e1457-8eb7-4fe8-a580-fb547656aad1 + vcpe_image_name: vCPE_images + skip_post_instantiation_configuration: true + nf_naming: + ecomp_generated_naming: true + multi_stage_design: 'false' + availability_zone_max_count: 1 + private_net_id: 1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d + vcpe_name: ar1000v + private_subnet_wan_id: 86048e4e-861e-47c9-ae55-a5531b747e36 + vnf_id: vCPE_huaweicloud + vcpe_flavor_name: vCPE_flavor + vcpe_private_ip_lan: 192.168.10.250 + requirements: + - abstract_vcpe.link_vcpe_vcpe_private_lan_port: + capability: virtual_linkable + node: Generic NeutronNet 0 + - abstract_vcpe.link_vcpe_vcpe_private_wan_port: + capability: virtual_linkable + node: Generic NeutronNet 0 + capabilities: + abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_lan_port: + properties: + unit: B/s + description: Average rate of outgoing bytes + type: Gauge + category: network + abstract_vcpe.scalable_vcpe: + properties: + max_instances: 1 + min_instances: 1 + abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_lan_port: + properties: + unit: B + description: Number of outgoing bytes + type: Cumulative + category: network + abstract_vcpe.disk.read.requests_vcpe: + properties: + unit: request + description: Number of read requests + type: Cumulative + category: compute + abstract_vcpe.disk.device.write.requests.rate_vcpe: + properties: + unit: request/s + description: Average rate of write requests + type: Gauge + category: disk + abstract_vcpe.disk.read.bytes.rate_vcpe: + properties: + unit: B/s + description: Average rate of reads + type: Gauge + category: compute + abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_wan_port: + properties: + unit: B/s + description: Average rate of outgoing bytes + type: Gauge + category: network + abstract_vcpe.disk.device.read.requests_vcpe: + properties: + unit: request + description: Number of read requests + type: Cumulative + category: disk + abstract_vcpe.disk.device.capacity_vcpe: + properties: + unit: B + description: The amount of disk per device that the instance can see + type: Gauge + category: disk + abstract_vcpe.cpu.delta_vcpe: + properties: + unit: ns + description: CPU time used since previous datapoint + type: Delta + category: compute + abstract_vcpe.port_mirroring_vcpe_vcpe_private_lan_port: + properties: + connection_point: + network_role: + get_input: port_vcpe_private_lan_port_network_role + nfc_naming_code: vcpe + abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_lan_port: + properties: + unit: B/s + description: Average rate of incoming bytes + type: Gauge + category: network + abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_lan_port: + properties: + unit: packet/s + description: Average rate of incoming packets + type: Gauge + category: network + abstract_vcpe.port_mirroring_vcpe_vcpe_private_wan_port: + properties: + connection_point: + network_role: + get_input: port_vcpe_private_wan_port_network_role + nfc_naming_code: vcpe + abstract_vcpe.cpu_vcpe: + properties: + unit: ns + description: CPU time used + type: Cumulative + category: compute + abstract_vcpe.disk.latency_vcpe: + properties: + unit: ms + description: Average disk latency + type: Gauge + category: disk + abstract_vcpe.disk.device.read.bytes_vcpe: + properties: + unit: B + description: Volume of reads + type: Cumulative + category: disk + abstract_vcpe.disk.write.bytes_vcpe: + properties: + unit: B + description: Volume of writes + type: Cumulative + category: compute + abstract_vcpe.disk.device.read.requests.rate_vcpe: + properties: + unit: request/s + description: Average rate of read requests + type: Gauge + category: disk + abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_wan_port: + properties: + unit: B + description: Number of outgoing bytes + type: Cumulative + category: network + abstract_vcpe.disk.root.size_vcpe: + properties: + unit: GB + description: Size of root disk + type: Gauge + category: compute + abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_lan_port: + properties: + unit: B + description: Number of incoming bytes + type: Cumulative + category: network + abstract_vcpe.disk.iops_vcpe: + properties: + unit: count/s + description: Average disk iops + type: Gauge + category: disk + abstract_vcpe.endpoint_vcpe: + properties: + secure: true + abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_lan_port: + properties: + unit: packet + description: Number of outgoing packets + type: Cumulative + category: network + abstract_vcpe.disk.device.write.requests_vcpe: + properties: + unit: request + description: Number of write requests + type: Cumulative + category: disk + abstract_vcpe.disk.write.bytes.rate_vcpe: + properties: + unit: B/s + description: Average rate of writes + type: Gauge + category: compute + abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_wan_port: + properties: + unit: packet/s + description: Average rate of outgoing packets + type: Gauge + category: network + abstract_vcpe.disk.capacity_vcpe: + properties: + unit: B + description: The amount of disk that the instance can see + type: Gauge + category: disk + abstract_vcpe.cpu_util_vcpe: + properties: + unit: '%' + description: Average CPU utilization + type: Gauge + category: compute + abstract_vcpe.disk.write.requests_vcpe: + properties: + unit: request + description: Number of write requests + type: Cumulative + category: compute + abstract_vcpe.disk.read.bytes_vcpe: + properties: + unit: B + description: Volume of reads + type: Cumulative + category: compute + abstract_vcpe.disk.device.write.bytes_vcpe: + properties: + unit: B + description: Volume of writes + type: Cumulative + category: disk + abstract_vcpe.disk.device.write.bytes.rate_vcpe: + properties: + unit: B/s + description: Average rate of writes + type: Gauge + category: disk + abstract_vcpe.vcpus_vcpe: + properties: + unit: vcpu + description: Number of virtual CPUs allocated to the instance + type: Gauge + category: compute + abstract_vcpe.disk.allocation_vcpe: + properties: + unit: B + description: The amount of disk occupied by the instance on the host machine + type: Gauge + category: disk + abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_wan_port: + properties: + unit: packet + description: Number of incoming packets + type: Cumulative + category: network + abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_wan_port: + properties: + unit: B/s + description: Average rate of incoming bytes + type: Gauge + category: network + abstract_vcpe.memory_vcpe: + properties: + unit: MB + description: Volume of RAM allocated to the instance + type: Gauge + category: compute + abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_lan_port: + properties: + unit: packet + description: Number of incoming packets + type: Cumulative + category: network + abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_wan_port: + properties: + unit: packet/s + description: Average rate of incoming packets + type: Gauge + category: network + abstract_vcpe.disk.device.read.bytes.rate_vcpe: + properties: + unit: B/s + description: Average rate of reads + type: Gauge + category: disk + abstract_vcpe.memory.usage_vcpe: + properties: + unit: MB + description: Volume of RAM used by the instance from the amount of its allocated memory + type: Gauge + category: compute + abstract_vcpe.disk.device.iops_vcpe: + properties: + unit: count/s + description: Average disk iops per device + type: Gauge + category: disk + abstract_vcpe.disk.device.allocation_vcpe: + properties: + unit: B + description: The amount of disk per device occupied by the instance on the host machine + type: Gauge + category: disk + abstract_vcpe.disk.usage_vcpe: + properties: + unit: B + description: The physical size in bytes of the image container on the host + type: Gauge + category: disk + abstract_vcpe.disk.device.latency_vcpe: + properties: + unit: ms + description: Average disk latency per device + type: Gauge + category: disk + abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_wan_port: + properties: + unit: packet + description: Number of outgoing packets + type: Cumulative + category: network + abstract_vcpe.disk.write.requests.rate_vcpe: + properties: + unit: request/s + description: Average rate of write requests + type: Gauge + category: compute + abstract_vcpe.instance_vcpe: + properties: + unit: instance + description: Existence of instance + type: Gauge + category: compute + abstract_vcpe.disk.device.usage_vcpe: + properties: + unit: B + description: The physical size in bytes of the image container on the host per device + type: Gauge + category: disk + abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_wan_port: + properties: + unit: B + description: Number of incoming bytes + type: Cumulative + category: network + abstract_vcpe.disk.ephemeral.size_vcpe: + properties: + unit: GB + description: Size of ephemeral disk + type: Gauge + category: compute + abstract_vcpe.memory.resident_vcpe: + properties: + unit: MB + description: Volume of RAM used by the instance on the physical machine + type: Gauge + category: compute + abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_lan_port: + properties: + unit: packet/s + description: Average rate of outgoing packets + type: Gauge + category: network + Generic NeutronNet 0: + type: org.openecomp.resource.vl.GenericNeutronNet + metadata: + invariantUUID: f3ed1133-c1bb-4735-82d4-8e041265fad6 + UUID: 24ec2ed8-a072-4f86-9a58-3a4fe220862e + customizationUUID: c8a1a81d-d836-4f33-9d0e-91e9417f812a + version: '1.0' + name: Generic NeutronNet + description: Generic NeutronNet + type: VL + category: Generic + subcategory: Network Elements + resourceVendor: ONAP (Tosca) + resourceVendorRelease: 1.0.0.wd03 + resourceVendorModelNumber: '' + properties: + network_assignments: + is_external_network: false + is_trunked: false + ipv4_subnet_default_assignment: + min_subnets_count: 1 + ecomp_generated_network_assignment: false + ipv6_subnet_default_assignment: + min_subnets_count: 1 + exVL_naming: + ecomp_generated_naming: true + network_flows: + is_network_policy: false + is_bound_to_vpn: false + network_ecomp_naming: + ecomp_generated_naming: true + network_type: NEUTRON + network_technology: NEUTRON + network_homing: + ecomp_selected_instance_node_target: false + vGW 0: + type: org.openecomp.resource.vf.Vgw + metadata: + invariantUUID: 52905e03-0632-43f9-93f2-2ab7d959f633 + UUID: 4f442b9c-237d-4d2d-b549-ee1bdb9842b3 + customizationUUID: fd8595de-1081-4e39-a401-24ffebaa9ed8 + version: '1.0' + name: vGW + description: vGW + type: VF + category: Generic + subcategory: Infrastructure + resourceVendor: huawei + resourceVendorRelease: '1.0' + resourceVendorModelNumber: '' + properties: + vf_module_id: CCVPNvGW + gateway_image_name: gateway_image + private_subnet_lan_id: 265e1457-8eb7-4fe8-a580-fb547656aad1 + skip_post_instantiation_configuration: true + nf_naming: + ecomp_generated_naming: true + multi_stage_design: 'false' + availability_zone_max_count: 1 + vnf_id: vGW_huaweicloud + private_net_id: 1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d + gateway_flavor_name: s3.large.4 + gateway_private_ip_lan: 192.168.10.200 + gateway_name: gateway-vm + requirements: + - abstract_gateway.link_gateway_gateway_private_lan_port: + capability: virtual_linkable + node: Generic NeutronNet 0 + capabilities: + abstract_gateway.network.incoming.bytes.rate_gateway_gateway_private_lan_port: + properties: + unit: B/s + description: Average rate of incoming bytes + type: Gauge + category: network + abstract_gateway.disk.device.read.bytes.rate_gateway: + properties: + unit: B/s + description: Average rate of reads + type: Gauge + category: disk + abstract_gateway.disk.capacity_gateway: + properties: + unit: B + description: The amount of disk that the instance can see + type: Gauge + category: disk + abstract_gateway.scalable_gateway: + properties: + max_instances: 1 + min_instances: 1 + abstract_gateway.disk.read.bytes_gateway: + properties: + unit: B + description: Volume of reads + type: Cumulative + category: compute + abstract_gateway.disk.allocation_gateway: + properties: + unit: B + description: The amount of disk occupied by the instance on the host machine + type: Gauge + category: disk + abstract_gateway.disk.device.write.requests_gateway: + properties: + unit: request + description: Number of write requests + type: Cumulative + category: disk + abstract_gateway.disk.device.read.bytes_gateway: + properties: + unit: B + description: Volume of reads + type: Cumulative + category: disk + abstract_gateway.cpu.delta_gateway: + properties: + unit: ns + description: CPU time used since previous datapoint + type: Delta + category: compute + abstract_gateway.network.outgoing.packets.rate_gateway_gateway_private_lan_port: + properties: + unit: packet/s + description: Average rate of outgoing packets + type: Gauge + category: network + abstract_gateway.cpu_gateway: + properties: + unit: ns + description: CPU time used + type: Cumulative + category: compute + abstract_gateway.disk.device.allocation_gateway: + properties: + unit: B + description: The amount of disk per device occupied by the instance on the host machine + type: Gauge + category: disk + abstract_gateway.disk.latency_gateway: + properties: + unit: ms + description: Average disk latency + type: Gauge + category: disk + abstract_gateway.disk.device.read.requests_gateway: + properties: + unit: request + description: Number of read requests + type: Cumulative + category: disk + abstract_gateway.disk.device.read.requests.rate_gateway: + properties: + unit: request/s + description: Average rate of read requests + type: Gauge + category: disk + abstract_gateway.disk.write.requests.rate_gateway: + properties: + unit: request/s + description: Average rate of write requests + type: Gauge + category: compute + abstract_gateway.disk.device.write.bytes.rate_gateway: + properties: + unit: B/s + description: Average rate of writes + type: Gauge + category: disk + abstract_gateway.cpu_util_gateway: + properties: + unit: '%' + description: Average CPU utilization + type: Gauge + category: compute + abstract_gateway.instance_gateway: + properties: + unit: instance + description: Existence of instance + type: Gauge + category: compute + abstract_gateway.network.outpoing.packets_gateway_gateway_private_lan_port: + properties: + unit: packet + description: Number of outgoing packets + type: Cumulative + category: network + abstract_gateway.disk.root.size_gateway: + properties: + unit: GB + description: Size of root disk + type: Gauge + category: compute + abstract_gateway.memory.usage_gateway: + properties: + unit: MB + description: Volume of RAM used by the instance from the amount of its allocated memory + type: Gauge + category: compute + abstract_gateway.network.outgoing.bytes_gateway_gateway_private_lan_port: + properties: + unit: B + description: Number of outgoing bytes + type: Cumulative + category: network + abstract_gateway.network.outgoing.bytes.rate_gateway_gateway_private_lan_port: + properties: + unit: B/s + description: Average rate of outgoing bytes + type: Gauge + category: network + abstract_gateway.disk.device.capacity_gateway: + properties: + unit: B + description: The amount of disk per device that the instance can see + type: Gauge + category: disk + abstract_gateway.disk.iops_gateway: + properties: + unit: count/s + description: Average disk iops + type: Gauge + category: disk + abstract_gateway.disk.write.requests_gateway: + properties: + unit: request + description: Number of write requests + type: Cumulative + category: compute + abstract_gateway.disk.device.write.bytes_gateway: + properties: + unit: B + description: Volume of writes + type: Cumulative + category: disk + abstract_gateway.disk.ephemeral.size_gateway: + properties: + unit: GB + description: Size of ephemeral disk + type: Gauge + category: compute + abstract_gateway.disk.device.write.requests.rate_gateway: + properties: + unit: request/s + description: Average rate of write requests + type: Gauge + category: disk + abstract_gateway.network.incoming.packets.rate_gateway_gateway_private_lan_port: + properties: + unit: packet/s + description: Average rate of incoming packets + type: Gauge + category: network + abstract_gateway.disk.device.iops_gateway: + properties: + unit: count/s + description: Average disk iops per device + type: Gauge + category: disk + abstract_gateway.endpoint_gateway: + properties: + secure: true + abstract_gateway.disk.device.latency_gateway: + properties: + unit: ms + description: Average disk latency per device + type: Gauge + category: disk + abstract_gateway.vcpus_gateway: + properties: + unit: vcpu + description: Number of virtual CPUs allocated to the instance + type: Gauge + category: compute + abstract_gateway.memory_gateway: + properties: + unit: MB + description: Volume of RAM allocated to the instance + type: Gauge + category: compute + abstract_gateway.network.incoming.bytes_gateway_gateway_private_lan_port: + properties: + unit: B + description: Number of incoming bytes + type: Cumulative + category: network + abstract_gateway.disk.read.bytes.rate_gateway: + properties: + unit: B/s + description: Average rate of reads + type: Gauge + category: compute + abstract_gateway.disk.read.requests_gateway: + properties: + unit: request + description: Number of read requests + type: Cumulative + category: compute + abstract_gateway.port_mirroring_gateway_gateway_private_lan_port: + properties: + connection_point: + network_role: + get_input: port_gateway_private_lan_port_network_role + nfc_naming_code: gateway + abstract_gateway.disk.device.usage_gateway: + properties: + unit: B + description: The physical size in bytes of the image container on the host per device + type: Gauge + category: disk + abstract_gateway.disk.write.bytes.rate_gateway: + properties: + unit: B/s + description: Average rate of writes + type: Gauge + category: compute + abstract_gateway.network.incoming.packets_gateway_gateway_private_lan_port: + properties: + unit: packet + description: Number of incoming packets + type: Cumulative + category: network + abstract_gateway.memory.resident_gateway: + properties: + unit: MB + description: Volume of RAM used by the instance on the physical machine + type: Gauge + category: compute + abstract_gateway.disk.usage_gateway: + properties: + unit: B + description: The physical size in bytes of the image container on the host + type: Gauge + category: disk + abstract_gateway.disk.write.bytes_gateway: + properties: + unit: B + description: Volume of writes + type: Cumulative + category: compute + groups: + vcpe0..Vcpe..ar1000v..module-0: + type: org.openecomp.groups.VfModule + metadata: + vfModuleModelName: Vcpe..ar1000v..module-0 + vfModuleModelInvariantUUID: d7719964-c045-4ed3-84d6-20a01db7612f + vfModuleModelUUID: c84ade8a-6e4b-49c7-86e8-0e4fc009f4cd + vfModuleModelVersion: '1' + vfModuleModelCustomizationUUID: 8caeefbd-ab71-40c9-9387-8729d7d9c2de + properties: + min_vf_module_instances: 1 + vf_module_label: ar1000v + max_vf_module_instances: 1 + vf_module_type: Base + isBase: true + initial_count: 1 + volume_group: false + vgw0..Vgw..gateway..module-0: + type: org.openecomp.groups.VfModule + metadata: + vfModuleModelName: Vgw..gateway..module-0 + vfModuleModelInvariantUUID: 8c8c936c-e71c-4bc4-94f7-c5680c9dbc00 + vfModuleModelUUID: ddda7e87-8113-463f-aa27-a60112a4e438 + vfModuleModelVersion: '1' + vfModuleModelCustomizationUUID: ea551d60-f9c9-48f2-9757-b01eb2d26d13 + properties: + min_vf_module_instances: 1 + vf_module_label: gateway + max_vf_module_instances: 1 + vf_module_type: Base + isBase: true + initial_count: 1 + volume_group: false + substitution_mappings: + node_type: org.openecomp.service.Publicns + capabilities: + vgw0.abstract_gateway.disk.allocation_gateway: + - vGW 0 + - abstract_gateway.disk.allocation_gateway + vgw0.abstract_gateway.memory.usage_gateway: + - vGW 0 + - abstract_gateway.memory.usage_gateway + vcpe0.abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_wan_port + vgw0.abstract_gateway.disk.device.write.bytes.rate_gateway: + - vGW 0 + - abstract_gateway.disk.device.write.bytes.rate_gateway + vgw0.abstract_gateway.disk.device.latency_gateway: + - vGW 0 + - abstract_gateway.disk.device.latency_gateway + vgw0.abstract_gateway.network.incoming.bytes.rate_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.incoming.bytes.rate_gateway_gateway_private_lan_port + vgw0.abstract_gateway.scalable_gateway: + - vGW 0 + - abstract_gateway.scalable_gateway + vcpe0.abstract_vcpe.host_vcpe: + - vCPE 0 + - abstract_vcpe.host_vcpe + vcpe0.abstract_vcpe.disk.latency_vcpe: + - vCPE 0 + - abstract_vcpe.disk.latency_vcpe + vcpe0.abstract_vcpe.scalable_vcpe: + - vCPE 0 + - abstract_vcpe.scalable_vcpe + vcpe0.abstract_vcpe.disk.device.write.bytes.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.write.bytes.rate_vcpe + vgw0.abstract_gateway.disk.write.requests.rate_gateway: + - vGW 0 + - abstract_gateway.disk.write.requests.rate_gateway + vcpe0.abstract_vcpe.feature_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.feature_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.disk.iops_vcpe: + - vCPE 0 + - abstract_vcpe.disk.iops_vcpe + vcpe0.abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.feature_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.feature_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.host_gateway: + - vGW 0 + - abstract_gateway.host_gateway + vgw0.abstract_gateway.disk.device.write.requests.rate_gateway: + - vGW 0 + - abstract_gateway.disk.device.write.requests.rate_gateway + vcpe0.abstract_vcpe.port_mirroring_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.port_mirroring_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.disk.device.capacity_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.capacity_vcpe + vcpe0.abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.os_vcpe: + - vCPE 0 + - abstract_vcpe.os_vcpe + vgw0.abstract_gateway.disk.usage_gateway: + - vGW 0 + - abstract_gateway.disk.usage_gateway + vcpe0.abstract_vcpe.binding_vcpe: + - vCPE 0 + - abstract_vcpe.binding_vcpe + vgw0.abstract_gateway.network.outgoing.bytes_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.outgoing.bytes_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.binding_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.binding_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.memory.resident_vcpe: + - vCPE 0 + - abstract_vcpe.memory.resident_vcpe + vgw0.abstract_gateway.disk.write.bytes_gateway: + - vGW 0 + - abstract_gateway.disk.write.bytes_gateway + vgw0.abstract_gateway.disk.read.bytes.rate_gateway: + - vGW 0 + - abstract_gateway.disk.read.bytes.rate_gateway + vcpe0.abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.disk.root.size_gateway: + - vGW 0 + - abstract_gateway.disk.root.size_gateway + vcpe0.abstract_vcpe.disk.write.requests_vcpe: + - vCPE 0 + - abstract_vcpe.disk.write.requests_vcpe + vcpe0.abstract_vcpe.disk.device.write.bytes_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.write.bytes_vcpe + vcpe0.abstract_vcpe.feature_vcpe: + - vCPE 0 + - abstract_vcpe.feature_vcpe + vcpe0.abstract_vcpe.disk.device.latency_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.latency_vcpe + vgw0.abstract_gateway.cpu_util_gateway: + - vGW 0 + - abstract_gateway.cpu_util_gateway + vgw0.abstract_gateway.network.incoming.packets_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.incoming.packets_gateway_gateway_private_lan_port + vgw0.abstract_gateway.disk.device.read.requests.rate_gateway: + - vGW 0 + - abstract_gateway.disk.device.read.requests.rate_gateway + vgw0.abstract_gateway.network.incoming.packets.rate_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.incoming.packets.rate_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.port_mirroring_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.port_mirroring_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.disk.write.bytes_vcpe: + - vCPE 0 + - abstract_vcpe.disk.write.bytes_vcpe + vgw0.abstract_gateway.disk.capacity_gateway: + - vGW 0 + - abstract_gateway.disk.capacity_gateway + vgw0.abstract_gateway.memory_gateway: + - vGW 0 + - abstract_gateway.memory_gateway + vcpe0.abstract_vcpe.cpu_util_vcpe: + - vCPE 0 + - abstract_vcpe.cpu_util_vcpe + vgw0.abstract_gateway.disk.device.write.requests_gateway: + - vGW 0 + - abstract_gateway.disk.device.write.requests_gateway + vgw0.abstract_gateway.vcpus_gateway: + - vGW 0 + - abstract_gateway.vcpus_gateway + vcpe0.abstract_vcpe.disk.ephemeral.size_vcpe: + - vCPE 0 + - abstract_vcpe.disk.ephemeral.size_vcpe + vgw0.abstract_gateway.disk.device.read.bytes_gateway: + - vGW 0 + - abstract_gateway.disk.device.read.bytes_gateway + vgw0.abstract_gateway.disk.device.allocation_gateway: + - vGW 0 + - abstract_gateway.disk.device.allocation_gateway + vgw0.abstract_gateway.disk.device.capacity_gateway: + - vGW 0 + - abstract_gateway.disk.device.capacity_gateway + vcpe0.abstract_vcpe.disk.write.requests.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.write.requests.rate_vcpe + vcpe0.abstract_vcpe.disk.usage_vcpe: + - vCPE 0 + - abstract_vcpe.disk.usage_vcpe + vgw0.abstract_gateway.disk.device.iops_gateway: + - vGW 0 + - abstract_gateway.disk.device.iops_gateway + vcpe0.abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.endpoint_gateway: + - vGW 0 + - abstract_gateway.endpoint_gateway + vcpe0.abstract_vcpe.disk.device.read.bytes.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.read.bytes.rate_vcpe + vcpe0.abstract_vcpe.disk.read.requests_vcpe: + - vCPE 0 + - abstract_vcpe.disk.read.requests_vcpe + vcpe0.abstract_vcpe.disk.read.bytes.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.read.bytes.rate_vcpe + vcpe0.abstract_vcpe.disk.device.read.bytes_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.read.bytes_vcpe + vgw0.abstract_gateway.binding_gateway: + - vGW 0 + - abstract_gateway.binding_gateway + vcpe0.abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.cpu.delta_vcpe: + - vCPE 0 + - abstract_vcpe.cpu.delta_vcpe + vcpe0.abstract_vcpe.disk.device.write.requests.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.write.requests.rate_vcpe + vgw0.abstract_gateway.instance_gateway: + - vGW 0 + - abstract_gateway.instance_gateway + vgw0.abstract_gateway.memory.resident_gateway: + - vGW 0 + - abstract_gateway.memory.resident_gateway + vcpe0.abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_wan_port + vgw0.abstract_gateway.disk.read.bytes_gateway: + - vGW 0 + - abstract_gateway.disk.read.bytes_gateway + vcpe0.abstract_vcpe.disk.device.iops_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.iops_vcpe + vgw0.abstract_gateway.binding_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.binding_gateway_gateway_private_lan_port + vgw0.abstract_gateway.disk.ephemeral.size_gateway: + - vGW 0 + - abstract_gateway.disk.ephemeral.size_gateway + vgw0.abstract_gateway.feature_gateway: + - vGW 0 + - abstract_gateway.feature_gateway + vcpe0.abstract_vcpe.forwarder_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.forwarder_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.disk.device.allocation_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.allocation_vcpe + vgw0.abstract_gateway.disk.read.requests_gateway: + - vGW 0 + - abstract_gateway.disk.read.requests_gateway + vcpe0.abstract_vcpe.disk.device.write.requests_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.write.requests_vcpe + vgw0.abstract_gateway.disk.device.usage_gateway: + - vGW 0 + - abstract_gateway.disk.device.usage_gateway + vgw0.abstract_gateway.cpu.delta_gateway: + - vGW 0 + - abstract_gateway.cpu.delta_gateway + vgw0.abstract_gateway.network.outgoing.packets.rate_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.outgoing.packets.rate_gateway_gateway_private_lan_port + vgw0.abstract_gateway.port_mirroring_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.port_mirroring_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.forwarder_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.forwarder_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.disk.latency_gateway: + - vGW 0 + - abstract_gateway.disk.latency_gateway + vcpe0.abstract_vcpe.disk.read.bytes_vcpe: + - vCPE 0 + - abstract_vcpe.disk.read.bytes_vcpe + vcpe0.abstract_vcpe.attachment_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.attachment_vcpe_vcpe_private_wan_port + vgw0.abstract_gateway.cpu_gateway: + - vGW 0 + - abstract_gateway.cpu_gateway + vcpe0.abstract_vcpe.instance_vcpe: + - vCPE 0 + - abstract_vcpe.instance_vcpe + vcpe0.abstract_vcpe.memory_vcpe: + - vCPE 0 + - abstract_vcpe.memory_vcpe + vgw0.abstract_gateway.feature_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.feature_gateway_gateway_private_lan_port + vgw0.abstract_gateway.disk.device.write.bytes_gateway: + - vGW 0 + - abstract_gateway.disk.device.write.bytes_gateway + vcpe0.abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_wan_port + vgw0.abstract_gateway.disk.device.read.requests_gateway: + - vGW 0 + - abstract_gateway.disk.device.read.requests_gateway + vgw0.abstract_gateway.disk.write.requests_gateway: + - vGW 0 + - abstract_gateway.disk.write.requests_gateway + vgw0.abstract_gateway.os_gateway: + - vGW 0 + - abstract_gateway.os_gateway + vgw0.abstract_gateway.network.outgoing.bytes.rate_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.outgoing.bytes.rate_gateway_gateway_private_lan_port + vgw0.abstract_gateway.network.outpoing.packets_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.outpoing.packets_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.disk.write.bytes.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.write.bytes.rate_vcpe + vgw0.abstract_gateway.disk.write.bytes.rate_gateway: + - vGW 0 + - abstract_gateway.disk.write.bytes.rate_gateway + vcpe0.abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.cpu_vcpe: + - vCPE 0 + - abstract_vcpe.cpu_vcpe + vcpe0.abstract_vcpe.disk.allocation_vcpe: + - vCPE 0 + - abstract_vcpe.disk.allocation_vcpe + vcpe0.abstract_vcpe.disk.device.read.requests.rate_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.read.requests.rate_vcpe + vgw0.abstract_gateway.network.incoming.bytes_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.network.incoming.bytes_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.disk.device.read.requests_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.read.requests_vcpe + vgw0.abstract_gateway.disk.device.read.bytes.rate_gateway: + - vGW 0 + - abstract_gateway.disk.device.read.bytes.rate_gateway + vcpe0.abstract_vcpe.binding_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.binding_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.forwarder_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.forwarder_gateway_gateway_private_lan_port + genericneutronnet0.virtual_linkable: + - Generic NeutronNet 0 + - virtual_linkable + vcpe0.abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.disk.device.usage_vcpe: + - vCPE 0 + - abstract_vcpe.disk.device.usage_vcpe + genericneutronnet0.feature: + - Generic NeutronNet 0 + - feature + vcpe0.abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.disk.root.size_vcpe: + - vCPE 0 + - abstract_vcpe.disk.root.size_vcpe + vcpe0.abstract_vcpe.vcpus_vcpe: + - vCPE 0 + - abstract_vcpe.vcpus_vcpe + vcpe0.abstract_vcpe.endpoint_vcpe: + - vCPE 0 + - abstract_vcpe.endpoint_vcpe + vgw0.abstract_gateway.attachment_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.attachment_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.attachment_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.attachment_vcpe_vcpe_private_lan_port + vcpe0.abstract_vcpe.memory.usage_vcpe: + - vCPE 0 + - abstract_vcpe.memory.usage_vcpe + vcpe0.abstract_vcpe.disk.capacity_vcpe: + - vCPE 0 + - abstract_vcpe.disk.capacity_vcpe + vgw0.abstract_gateway.disk.iops_gateway: + - vGW 0 + - abstract_gateway.disk.iops_gateway + requirements: + vcpe0.abstract_vcpe.dependency_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.dependency_vcpe_vcpe_private_wan_port + vcpe0.abstract_vcpe.link_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.link_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.local_storage_gateway: + - vGW 0 + - abstract_gateway.local_storage_gateway + genericneutronnet0.dependency: + - Generic NeutronNet 0 + - dependency + vcpe0.abstract_vcpe.local_storage_vcpe: + - vCPE 0 + - abstract_vcpe.local_storage_vcpe + vcpe0.abstract_vcpe.dependency_vcpe_vcpe_private_lan_port: + - vCPE 0 + - abstract_vcpe.dependency_vcpe_vcpe_private_lan_port + vgw0.abstract_gateway.dependency_gateway: + - vGW 0 + - abstract_gateway.dependency_gateway + vcpe0.abstract_vcpe.dependency_vcpe: + - vCPE 0 + - abstract_vcpe.dependency_vcpe + vgw0.abstract_gateway.dependency_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.dependency_gateway_gateway_private_lan_port + vcpe0.abstract_vcpe.link_vcpe_vcpe_private_wan_port: + - vCPE 0 + - abstract_vcpe.link_vcpe_vcpe_private_wan_port + vgw0.abstract_gateway.link_gateway_gateway_private_lan_port: + - vGW 0 + - abstract_gateway.link_gateway_gateway_private_lan_port diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env new file mode 100644 index 0000000000..f0cc985078 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env @@ -0,0 +1,10 @@ +parameters: + private_net_id: "1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d" + private_subnet_lan_id: "265e1457-8eb7-4fe8-a580-fb547656aad1" + private_subnet_wan_id: "86048e4e-861e-47c9-ae55-a5531b747e36" + vcpe_flavor_name: "vCPE_flavor" + vcpe_image_name: "vCPE_images" + vcpe_name: "ar1000v" + vcpe_private_ip_lan: "192.168.10.250" + vf_module_id: "vCPEAR1000V" + vnf_id: "vCPE_huaweicloud" diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml new file mode 100644 index 0000000000..b4d0fa7a6b --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml @@ -0,0 +1,103 @@ +########################################################################## +# +#==================LICENSE_START========================================== +# +# +# Copyright 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============================================ + +heat_template_version: 2013-05-23 + +description: Heat template to deploy Huawei AR1000V vCPE + +############## +# # +# PARAMETERS # +# # +############## + +parameters: + vcpe_name: + type: string + label: name + description: name to be used for compute instance + vcpe_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + vcpe_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + private_net_id: + type: string + label: Private oam network name or ID + description: Private network that enables remote connection to VNF + private_subnet_wan_id: + type: string + label: Private wan sub-network name or ID + description: Private wan sub-network that enables remote connection to VNF + private_subnet_lan_id: + type: string + label: Private lan sub-network name or ID + description: Private lan sub-network that enables remote connection to VNF + vcpe_private_ip_lan: + type: string + label: vCPE lan private IP address + description: Private IP address that is assigned to the vCPE lan port + vnf_id: + type: string + label: VNF ID + description: The VNF ID is provided by ECOMP + vf_module_id: + type: string + label: VF module id + description: the vf module id is provided by ECOMP +############# +# # +# RESOURCES # +# # +############# + +resources: +# For the floating IP in Public cloud , floating_network_id is not needed + vCPE_oam_floating_ip: + type: OS::Neutron::FloatingIP + properties: + floating_network_id: { get_param: private_net_id} + port_id: { get_resource: vcpe_private_wan_port} + + vcpe_private_wan_port: + type: OS::Neutron::Port + properties: + network: { get_param: private_net_id } + fixed_ips: [{"subnet": { get_param: private_subnet_wan_id }}] + + vcpe_private_lan_port: + type: OS::Neutron::Port + properties: + network: { get_param: private_net_id } + fixed_ips: [{"subnet": { get_param: private_subnet_lan_id }, "ip_address": { get_param: vcpe_private_ip_lan }}] + + ar_1000v: + type: OS::Nova::Server + properties: + image: { get_param: vcpe_image_name } + flavor: { get_param: vcpe_flavor_name } + name: { get_param: vcpe_name } + networks: + - port: { get_resource: vcpe_private_wan_port } + - port: { get_resource: vcpe_private_lan_port } + metadata: { vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json new file mode 100644 index 0000000000..3376b1bf40 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json @@ -0,0 +1,25 @@ +[ + { + "vfModuleModelName": "Vcpe..ar1000v..module-0", + "vfModuleModelInvariantUUID": "d7719964-c045-4ed3-84d6-20a01db7612f", + "vfModuleModelVersion": "1", + "vfModuleModelUUID": "c84ade8a-6e4b-49c7-86e8-0e4fc009f4cd", + "vfModuleModelCustomizationUUID": "8caeefbd-ab71-40c9-9387-8729d7d9c2de", + "isBase": true, + "artifacts": [ + "12dcc618-20f2-4f15-ab00-c549b96b3910", + "5821b043-ba50-49ef-b739-61b0896050f2" + ], + "properties": { + "min_vf_module_instances": "1", + "vf_module_label": "ar1000v", + "max_vf_module_instances": "1", + "vfc_list": "", + "vf_module_description": "", + "vf_module_type": "Base", + "availability_zone_count": "", + "volume_group": "false", + "initial_count": "1" + } + } +]
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml new file mode 100644 index 0000000000..a10a5b2bb1 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml @@ -0,0 +1 @@ +<vendor-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><entitlement-pool-list><entitlement-pool><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><version>1.0</version><name>test</name><description/><increments/><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><version>1.0</version><name>test</name><description/><type>One_Time</type><increments/><manufacturerReferenceNumber>123</manufacturerReferenceNumber><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list></vendor-license-model>
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml new file mode 100644 index 0000000000..ed1575b7f5 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml @@ -0,0 +1 @@ +<vf-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><vf-id>c1aad4e55922438f956ff97b91c5446d</vf-id><feature-group-list><feature-group><entitlement-pool-list><entitlement-pool><name>test</name><description/><increments/><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><name>test</name><description/><type>One_Time</type><increments/><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><manufacturer-reference-number>123</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list><name>testgroup</name><feature-group-uuid>ae361d4e44ca48e68f734abb531e19af</feature-group-uuid><description/><part-number>123</part-number></feature-group></feature-group-list></vf-license-model>
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env new file mode 100644 index 0000000000..a995d16b31 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env @@ -0,0 +1,9 @@ +parameters: + gateway_flavor_name: "s3.large.4" + gateway_image_name: "gateway_image" + gateway_name: "gateway-vm" + gateway_private_ip_lan: "192.168.10.200" + private_net_id: "1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d" + private_subnet_lan_id: "265e1457-8eb7-4fe8-a580-fb547656aad1" + vf_module_id: "CCVPNvGW" + vnf_id: "vGW_huaweicloud" diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml new file mode 100644 index 0000000000..2d72a1c183 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml @@ -0,0 +1,109 @@ +########################################################################## +# +#==================LICENSE_START========================================== +# +# +# Copyright 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============================================ + +heat_template_version: 2013-05-23 + +description: Heat template to deploy CCVPN gateway instance + +############## +# # +# PARAMETERS # +# # +############## + +parameters: + gateway_name: + type: string + label: name + description: name to be used for compute instance + gateway_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + gateway_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + private_net_id: + type: string + label: Private oam network name or ID + description: Private network that enables remote connection to VNF +# private_subnet_wan_id: +# type: string +# label: Private wan sub-network name or ID +# description: Private wan sub-network that enables remote connection to VNF + private_subnet_lan_id: + type: string + label: Private lan sub-network name or ID + description: Private lan sub-network that enables remote connection to VNF + gateway_private_ip_lan: + type: string + label: gateway lan private IP address + description: Private IP address that is assigned to the gateway lan port + vnf_id: + type: string + label: VNF ID + description: The VNF ID is provided by ECOMP + vf_module_id: + type: string + label: VF module id + description: the vf module id is provided by ECOMP +############# +# # +# RESOURCES # +# # +############# + +resources: +# For the floating IP in Public cloud , floating_network_id is not needed + gateway_oam_floating_ip: + type: OS::Neutron::FloatingIP + properties: + floating_network_id: { get_param: private_net_id} + port_id: { get_resource: gateway_private_lan_port} + + #gateway_private_wan_port: + # type: OS::Neutron::Port + # properties: + # network: { get_param: private_net_id } + # fixed_ips: [{"subnet": { get_param: private_subnet_wan_id }}] + + gateway_private_lan_port: + type: OS::Neutron::Port + properties: + network: { get_param: private_net_id } + fixed_ips: [{"subnet": { get_param: private_subnet_lan_id }, "ip_address": { get_param: gateway_private_ip_lan }}] + + gateway_instacne: + type: OS::Nova::Server + properties: + image: { get_param: gateway_image_name } + flavor: { get_param: gateway_flavor_name } + name: { get_param: gateway_name } + networks: + #- port: { get_resource: gateway_private_wan_port } + - port: { get_resource: gateway_private_lan_port } + metadata: { vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data: | + #!/bin/bash + docker start msb_consul + docker start msb_discovery + docker start msb_internal_apigateway + #user_data_format: HEAT_CFNTOOLS/RAW
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml new file mode 100644 index 0000000000..a10a5b2bb1 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml @@ -0,0 +1 @@ +<vendor-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><entitlement-pool-list><entitlement-pool><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><version>1.0</version><name>test</name><description/><increments/><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><version>1.0</version><name>test</name><description/><type>One_Time</type><increments/><manufacturerReferenceNumber>123</manufacturerReferenceNumber><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list></vendor-license-model>
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml new file mode 100644 index 0000000000..a4a84cc4c0 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml @@ -0,0 +1 @@ +<vf-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><vf-id>8c1c2b40525942aca038a4528ce3bb4e</vf-id><feature-group-list><feature-group><entitlement-pool-list><entitlement-pool><name>test</name><description/><increments/><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><name>test</name><description/><type>One_Time</type><increments/><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><manufacturer-reference-number>123</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list><name>testgroup</name><feature-group-uuid>ae361d4e44ca48e68f734abb531e19af</feature-group-uuid><description/><part-number>123</part-number></feature-group></feature-group-list></vf-license-model>
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json new file mode 100644 index 0000000000..1a1badec5e --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json @@ -0,0 +1,25 @@ +[ + { + "vfModuleModelName": "Vgw..gateway..module-0", + "vfModuleModelInvariantUUID": "8c8c936c-e71c-4bc4-94f7-c5680c9dbc00", + "vfModuleModelVersion": "1", + "vfModuleModelUUID": "ddda7e87-8113-463f-aa27-a60112a4e438", + "vfModuleModelCustomizationUUID": "ea551d60-f9c9-48f2-9757-b01eb2d26d13", + "isBase": true, + "artifacts": [ + "60d55796-212c-4c66-8af5-63964d636ae4", + "9df0452f-826c-4287-9a2d-ca0095339866" + ], + "properties": { + "min_vf_module_instances": "1", + "vf_module_label": "gateway", + "max_vf_module_instances": "1", + "vfc_list": "", + "vf_module_description": "", + "vf_module_type": "Base", + "availability_zone_count": "", + "volume_group": "false", + "initial_count": "1" + } + } +]
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql index ad6b156956..f2c04802a5 100644 --- a/asdc-controller/src/test/resources/schema.sql +++ b/asdc-controller/src/test/resources/schema.sql @@ -1447,7 +1447,7 @@ CREATE TABLE `infra_active_requests` ( `VF_MODULE_NAME` varchar(200) DEFAULT NULL, `VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL, `AAI_SERVICE_ID` varchar(50) DEFAULT NULL, - `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL, + `CLOUD_REGION` varchar(11) DEFAULT NULL, `CALLBACK_URL` varchar(200) DEFAULT NULL, `CORRELATOR` varchar(80) DEFAULT NULL, `NETWORK_ID` varchar(45) DEFAULT NULL, @@ -1500,7 +1500,7 @@ CREATE TABLE `archived_infra_requests` ( `VF_MODULE_NAME` varchar(200) DEFAULT NULL, `VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL, `AAI_SERVICE_ID` varchar(50) DEFAULT NULL, - `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL, + `CLOUD_REGION` varchar(11) DEFAULT NULL, `CALLBACK_URL` varchar(200) DEFAULT NULL, `CORRELATOR` varchar(80) DEFAULT NULL, `NETWORK_ID` varchar(45) DEFAULT NULL, diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java index d401522800..ce53044052 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,13 +25,15 @@ import java.util.Map; import java.util.Optional; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.client.aai.AAIObjectType; -import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class AAICreateResources extends AAIResource { + private static final Logger logger = LoggerFactory.getLogger(AAICreateResources.class); public void createAAIProject(String projectName, String serviceInstance) { AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName); @@ -89,6 +91,7 @@ public class AAICreateResources extends AAIResource { Optional<GenericVnf> vnf = aaiResponse.asBean(GenericVnf.class); return vnf; } catch (Exception ex) { + logger.error("Exception in getVnfInstance", ex); return Optional.empty(); } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java index 2526ca5c25..c489ef29ce 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,13 +24,19 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; import org.onap.so.bpmn.common.scripts.ExceptionUtil; import org.onap.so.client.aai.AAIObjectType; -import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; -import org.springframework.stereotype.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate { + private static final Logger logger = LoggerFactory.getLogger(AAIDeleteServiceInstance.class); + + private static final String ERROR_MESSAGE = + "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI."; + ExceptionUtil exceptionUtil = new ExceptionUtil(); public void execute(DelegateExecution execution) throws Exception { @@ -41,9 +47,8 @@ public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegat getAaiClient().delete(serviceInstanceURI); execution.setVariable("GENDS_SuccessIndicator", true); } catch (Exception ex) { - String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." - + ex.getMessage(); - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg); + logger.error(ERROR_MESSAGE, ex); + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ERROR_MESSAGE + ex.getMessage()); } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java index 493340c9ef..216f426ec0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java @@ -62,6 +62,7 @@ public class CheckAaiForPnfCorrelationIdDelegate implements JavaDelegate { logger.debug("AAI entry is found for pnf correlation id {}: {}", PNF_CORRELATION_ID, isEntry); execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, isEntry); } catch (IOException e) { + logger.error("Exception in check AAI for pnf_correlation_id execution", e); new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage()); } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java index a011346756..ee86ca4292 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java @@ -65,7 +65,7 @@ public class ConfigCheckerDelegate implements JavaDelegate { delegateExecution.setVariable(MODEL_UUID, serviceModelUuid); List<PnfResourceCustomization> pnfCustomizations = catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid); - if (pnfCustomizations != null && pnfCustomizations.size() >= 1) { + if (pnfCustomizations != null && !pnfCustomizations.isEmpty()) { PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0); boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf(); delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION, diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java index 6d73b61ab2..781ee5cda4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java @@ -48,6 +48,7 @@ public class CreateRelation implements JavaDelegate { try { pnfManagementImpl.createRelation(serviceInstanceId, pnfName); } catch (Exception e) { + logger.error("An exception occurred when making service and pnf relation. Exception:", e); new ExceptionUtil().buildAndThrowWorkflowException(delegateExecution, 9999, "An exception occurred when making service and pnf relation. Exception: " + e.getMessage()); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index 8822bc39dd..64f0072991 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java @@ -153,16 +153,6 @@ public class OrchestrationStatusValidator { .getOrchestrationStatusStateTransitionDirective(buildingBlockDetail.getResourceType(), orchestrationStatus, buildingBlockDetail.getTargetAction()); - if (aLaCarte && ResourceType.VF_MODULE.equals(buildingBlockDetail.getResourceType()) - && OrchestrationAction.CREATE.equals(buildingBlockDetail.getTargetAction()) - && OrchestrationStatus.PENDING_ACTIVATION.equals(orchestrationStatus)) { - org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf = - extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); - orchestrationStatusStateTransitionDirective = processPossibleSecondStageofVfModuleCreate(execution, - previousOrchestrationStatusValidationResult, genericVnf, - orchestrationStatusStateTransitionDirective); - } - if (orchestrationStatusStateTransitionDirective .getFlowDirective() == OrchestrationStatusValidationDirective.FAIL) { throw new OrchestrationStatusValidationException( @@ -187,23 +177,4 @@ public class OrchestrationStatusValidator { exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e); } } - - private OrchestrationStatusStateTransitionDirective processPossibleSecondStageofVfModuleCreate( - BuildingBlockExecution execution, - OrchestrationStatusValidationDirective previousOrchestrationStatusValidationResult, - org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf, - OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective) { - if (previousOrchestrationStatusValidationResult != null && previousOrchestrationStatusValidationResult - .equals(OrchestrationStatusValidationDirective.SILENT_SUCCESS)) { - String multiStageDesign = MULTI_STAGE_DESIGN_OFF; - if (genericVnf.getModelInfoGenericVnf() != null) { - multiStageDesign = genericVnf.getModelInfoGenericVnf().getMultiStageDesign(); - } - if (multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) { - orchestrationStatusStateTransitionDirective - .setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE); - } - } - return orchestrationStatusStateTransitionDirective; - } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 100f81a0c7..d5798150d1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -290,12 +290,12 @@ public class WorkflowActionBBTasks { flowsToExecute.remove(i); } else { String flowName = flowsToExecute.get(i).getBuildingBlock().getBpmnFlowName(); - if (flowName.contains("Assign")) { - flowName = "Unassign" + flowName.substring(6, flowName.length()); - } else if (flowName.contains("Create")) { - flowName = "Delete" + flowName.substring(6, flowName.length()); - } else if (flowName.contains("Activate")) { - flowName = "Deactivate" + flowName.substring(8, flowName.length()); + if (flowName.startsWith("Assign")) { + flowName = flowName.replaceFirst("Assign", "Unassign"); + } else if (flowName.startsWith("Create")) { + flowName = flowName.replaceFirst("Create", "Delete"); + } else if (flowName.startsWith("Activate")) { + flowName = flowName.replaceFirst("Activate", "Deactivate"); } else { continue; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java index 867d80a4ea..8b939940fa 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java @@ -52,7 +52,7 @@ public class AAIConfigurationResources { AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, configuration.getConfigurationId()); configuration.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); org.onap.aai.domain.yang.Configuration aaiConfiguration = aaiObjectMapper.mapConfiguration(configuration); - injectionHelper.getAaiClient().create(configurationURI, aaiConfiguration); + injectionHelper.getAaiClient().createIfNotExists(configurationURI, Optional.of(aaiConfiguration)); } /** diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java index 63bde79b3f..7ad74a6d86 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java @@ -33,6 +33,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.client.aai.AAIObjectPlurals; import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.aai.AAIRestClientImpl; import org.onap.so.client.aai.AAIValidatorImpl; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIResourceUri; @@ -151,6 +152,8 @@ public class AAIVnfResources { .get(org.onap.aai.domain.yang.GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)) .orElse(new org.onap.aai.domain.yang.GenericVnf()); + AAIRestClientImpl client = new AAIRestClientImpl(); + aaiValidatorImpl.setClient(client); return aaiValidatorImpl.isPhysicalServerLocked(vnf.getVnfId()); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java index d4a4cfbd8a..0123eb67be 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java @@ -32,8 +32,6 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.client.sdnc.mapper.NetworkTopologyOperationRequestMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java index b3ea18df58..01511eaccc 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java @@ -37,14 +37,11 @@ import org.onap.so.client.sdnc.SDNCClient; import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.client.sdnc.mapper.VfModuleTopologyOperationRequestMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCVfModuleResources { - private static final Logger logger = LoggerFactory.getLogger(SDNCVfModuleResources.class); @Autowired private VfModuleTopologyOperationRequestMapper sdncRM; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java index 6434bfb176..27edeed02a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java @@ -36,8 +36,6 @@ import org.onap.so.client.sdnc.SDNCClient; import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.client.sdnc.mapper.VnfTopologyOperationRequestMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java index 62d6a110f6..6a15ca321a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java @@ -34,8 +34,6 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper; import org.onap.so.client.adapter.vnf.mapper.exceptions.MissingValueTagException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java index 2e7877fe3b..07f448e5e1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java @@ -29,8 +29,6 @@ import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.beans.SDNCProperties; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java index b8146b5504..2c8bdd931c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java @@ -36,7 +36,7 @@ public class SDNCRequest implements Serializable { private SDNCTopology topology; private String correlationValue = UUID.randomUUID().toString(); private String correlationName = "SDNCCallback"; - private Object sdncPayload; + private transient Object sdncPayload; public String getTimeOut() { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java index d07574a1ad..c63cbc0b68 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java @@ -37,7 +37,6 @@ import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.core.JsonProcessingException; @Component diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java index b371e3a48a..ffe48876c4 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java @@ -21,6 +21,7 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; @@ -50,7 +51,6 @@ import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective; import org.onap.so.db.catalog.beans.ResourceType; import org.springframework.beans.factory.annotation.Autowired; -@Ignore public class OrchestrationStatusValidatorTest extends BaseTaskTest { @InjectMocks protected OrchestrationStatusValidator orchestrationStatusValidator = new OrchestrationStatusValidator(); @@ -72,6 +72,13 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstance = + new org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance(); + serviceInstance.setServiceInstanceId("serviceInstanceId"); + serviceInstance.setOrchestrationStatus(OrchestrationStatus.PRECREATED); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID))) + .thenReturn(serviceInstance); + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE); @@ -115,6 +122,13 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration configuration = + new org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration(); + configuration.setConfigurationId("configurationId"); + configuration.setOrchestrationStatus(OrchestrationStatus.PRECREATED); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.CONFIGURATION_ID))) + .thenReturn(configuration); + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); orchestrationStatusStateTransitionDirective @@ -134,6 +148,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { execution.getVariable("orchestrationStatusValidationResult")); } + @Ignore @Test public void test_validateOrchestrationStatus_buildingBlockDetailNotFound() throws Exception { expectedException.expect(BpmnError.class); @@ -147,6 +162,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { orchestrationStatusValidator.validateOrchestrationStatus(execution); } + @Ignore @Test public void test_validateOrchestrationStatus_orchestrationValidationFail() throws Exception { expectedException.expect(BpmnError.class); @@ -178,6 +194,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { orchestrationStatusValidator.validateOrchestrationStatus(execution); } + @Ignore @Test public void test_validateOrchestrationStatus_orchestrationValidationNotFound() throws Exception { expectedException.expect(BpmnError.class); @@ -228,8 +245,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { orchestrationStatusValidator.validateOrchestrationStatus(execution); - assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, - execution.getVariable("orchestrationStatusValidationResult")); + assertNull(execution.getVariable("orchestrationStatusValidationResult")); } @Test @@ -247,6 +263,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { setGenericVnf().setModelInfoGenericVnf(modelInfoGenericVnf); setVfModule().setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail(); buildingBlockDetail.setBuildingBlockName("CreateVfModuleBB"); buildingBlockDetail.setId(1); @@ -257,7 +279,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); - orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.FAIL); + orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE); orchestrationStatusStateTransitionDirective.setId(1); orchestrationStatusStateTransitionDirective.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); orchestrationStatusStateTransitionDirective.setResourceType(ResourceType.VF_MODULE); @@ -288,6 +310,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { setGenericVnf().setModelInfoGenericVnf(modelInfoGenericVnf); setVfModule().setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail(); buildingBlockDetail.setBuildingBlockName("CreateVfModuleBB"); buildingBlockDetail.setId(1); @@ -338,6 +366,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); orchestrationStatusStateTransitionDirective @@ -380,6 +414,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.ASSIGNED); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); orchestrationStatusStateTransitionDirective @@ -422,6 +462,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); orchestrationStatusStateTransitionDirective @@ -464,6 +510,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective(); orchestrationStatusStateTransitionDirective @@ -482,4 +534,39 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); } + + @Test + public void continueValidationActivatedTest() throws Exception { + String flowToBeCalled = "DeactivateVnfBB"; + BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail(); + buildingBlockDetail.setBuildingBlockName(flowToBeCalled); + buildingBlockDetail.setId(1); + buildingBlockDetail.setResourceType(ResourceType.VF_MODULE); + buildingBlockDetail.setTargetAction(OrchestrationAction.DEACTIVATE); + when(catalogDbClient.getBuildingBlockDetail(flowToBeCalled)).thenReturn(buildingBlockDetail); + + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.ACTIVATED); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = + new OrchestrationStatusStateTransitionDirective(); + orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE); + orchestrationStatusStateTransitionDirective.setId(1); + orchestrationStatusStateTransitionDirective.setOrchestrationStatus(OrchestrationStatus.ACTIVATED); + orchestrationStatusStateTransitionDirective.setResourceType(ResourceType.VF_MODULE); + orchestrationStatusStateTransitionDirective.setTargetAction(OrchestrationAction.DEACTIVATE); + doReturn(orchestrationStatusStateTransitionDirective).when(catalogDbClient) + .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.ACTIVATED, + OrchestrationAction.DEACTIVATE); + + execution.setVariable("aLaCarte", true); + execution.setVariable("flowToBeCalled", flowToBeCalled); + orchestrationStatusValidator.validateOrchestrationStatus(execution); + + assertEquals(OrchestrationStatusValidationDirective.CONTINUE, + execution.getVariable("orchestrationStatusValidationResult")); + } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java index 68f3d20c82..9855c8587a 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java @@ -96,14 +96,12 @@ public class AAIConfigurationResourcesTest extends TestDataSetup { public void createConfigurationTest() { doReturn(new org.onap.aai.domain.yang.Configuration()).when(MOCK_aaiObjectMapper) .mapConfiguration(configuration); - doNothing().when(MOCK_aaiResourcesClient).create(isA(AAIResourceUri.class), - isA(org.onap.aai.domain.yang.Configuration.class)); - + doReturn(MOCK_aaiResourcesClient).when(MOCK_aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), + any(Optional.class)); aaiConfigurationResources.createConfiguration(configuration); assertEquals(OrchestrationStatus.INVENTORIED, configuration.getOrchestrationStatus()); - verify(MOCK_aaiResourcesClient, times(1)).create(any(AAIResourceUri.class), - isA(org.onap.aai.domain.yang.Configuration.class)); + verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class)); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java index 3680eaac81..425b595686 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java @@ -53,6 +53,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.client.aai.AAIObjectPlurals; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.AAIResourcesClient; +import org.onap.so.client.aai.AAIRestClientImpl; import org.onap.so.client.aai.AAIValidatorImpl; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIResourceUri; @@ -234,6 +235,7 @@ public class AAIVnfResourcesTest extends TestDataSetup { boolean isVnfPserversLockedFlag = aaiVnfResources.checkVnfPserversLockedFlag("vnfId"); verify(MOCK_aaiResourcesClient, times(1)).get(eq(org.onap.aai.domain.yang.GenericVnf.class), isA(AAIResourceUri.class)); + verify(MOCK_aaiValidatorImpl, times(1)).setClient(isA(AAIRestClientImpl.class)); verify(MOCK_aaiValidatorImpl, times(1)).isPhysicalServerLocked(isA(String.class)); assertTrue(isVnfPserversLockedFlag); } diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java index f031f10bb5..652df6ff0d 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ package org.onap.so.cloudify.base.client; - +@FunctionalInterface public interface CloudifyClientConnector { public <T> CloudifyResponse request(CloudifyRequest<T> request); diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java index 966cc8f144..0ca3212238 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,11 +26,11 @@ public class CloudifyResponseException extends CloudifyBaseException { private static final long serialVersionUID = 7294957362769575271L; - protected String message; - protected int status; + private final String message; + private final int status; // Make the response available for exception handling (includes body) - protected CloudifyResponse response; + private final CloudifyResponse response; public CloudifyResponseException(String message, int status) { this.message = message; diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java index ba6a5911b7..54519bac72 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,7 +94,7 @@ public class HttpClientConnector implements CloudifyClientConnector { public <T> CloudifyResponse request(CloudifyRequest<T> request) { - CloseableHttpClient httpClient = null; // HttpClients.createDefault(); + CloseableHttpClient httpClient = null; if (request.isBasicAuth()) { // Use Basic Auth for this request. @@ -211,11 +211,14 @@ public class HttpClientConnector implements CloudifyClientConnector { } catch (HttpResponseException e) { // What exactly does this mean? It does not appear to get thrown for // non-2XX responses as documented. + logger.error("Client HttpResponseException", e); throw new CloudifyResponseException(e.getMessage(), e.getStatusCode()); } catch (UnknownHostException e) { + logger.error("Client UnknownHostException", e); throw new CloudifyConnectException("Unknown Host: " + e.getMessage()); } catch (IOException e) { // Catch all other IOExceptions and throw as OpenStackConnectException + logger.error("Client IOException", e); throw new CloudifyConnectException(e.getMessage()); } catch (Exception e) { // Catchall for anything else, must throw as a RuntimeException @@ -227,7 +230,7 @@ public class HttpClientConnector implements CloudifyClientConnector { try { httpResponse.close(); } catch (IOException e) { - logger.debug("Unable to close HTTP Response: " + e); + logger.debug("Unable to close HTTP Response: ", e); } } diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java index a96fdb6b50..f1aa06cb39 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,7 +39,7 @@ public class HttpClientResponse implements CloudifyResponse { private static Logger logger = LoggerFactory.getLogger(HttpClientResponse.class); - private HttpResponse response = null; + private transient HttpResponse response = null; private String entityBody = null; public HttpClientResponse(HttpResponse response) { diff --git a/common/pom.xml b/common/pom.xml index 2553038e6b..1a4ffe13a8 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -191,7 +191,11 @@ <artifactId>javatuples</artifactId> <version>1.2</version> </dependency> - + <dependency> + <groupId>org.camunda.bpm</groupId> + <artifactId>camunda-external-task-client</artifactId> + <version>1.1.1</version> + </dependency> </dependencies> <dependencyManagement> <dependencies> diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java index ad3bb6c311..540472a88d 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java @@ -27,6 +27,8 @@ import java.util.List; import java.util.stream.Collectors; import org.onap.so.client.aai.entities.QueryStep; import org.onap.so.client.graphinventory.GraphInventoryObjectName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.base.Joiner; @@ -34,6 +36,7 @@ public class DSLQueryBuilder<S, E> implements QueryStep { private List<QueryStep> steps = new ArrayList<>(); private String suffix = ""; + private static final Logger logger = LoggerFactory.getLogger(DSLQueryBuilder.class); public DSLQueryBuilder() { @@ -64,6 +67,7 @@ public class DSLQueryBuilder<S, E> implements QueryStep { ((DSLNode) ((DSLQueryBuilder) o).steps.get(0)).output(); } } catch (IllegalArgumentException | IllegalAccessException e) { + logger.error("Exception occured", e); } f.setAccessible(false); break; diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java new file mode 100644 index 0000000000..e43b431821 --- /dev/null +++ b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java @@ -0,0 +1,46 @@ +package org.onap.so.utils; + +import java.security.GeneralSecurityException; +import org.camunda.bpm.client.ExternalTaskClient; +import org.camunda.bpm.client.interceptor.ClientRequestInterceptor; +import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; + +@Component +public class ExternalTaskServiceUtils { + + @Autowired + public Environment env; + + private static final Logger logger = LoggerFactory.getLogger(ExternalTaskServiceUtils.class); + + public ExternalTaskClient createExternalTaskClient() throws Exception { + String auth = getAuth(); + ClientRequestInterceptor interceptor = createClientInterceptor(auth); + return ExternalTaskClient.create().baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1) + .addInterceptor(interceptor).asyncResponseTimeout(120000).build(); + } + + protected ClientRequestInterceptor createClientInterceptor(String auth) { + return new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth); + } + + protected String getAuth() throws Exception { + try { + return CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey")); + } catch (IllegalStateException | GeneralSecurityException e) { + logger.error("Error Decrypting Password", e); + throw new Exception("Cannot load password"); + } + } + + public int getMaxClients() { + return Integer.parseInt(env.getProperty("workflow.topics.maxClients", "3")); + } + + +} diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java new file mode 100644 index 0000000000..349767fc5b --- /dev/null +++ b/common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java @@ -0,0 +1,46 @@ +package org.onap.so.utils; + +import org.camunda.bpm.client.task.ExternalTask; +import org.onap.logging.ref.slf4j.ONAPLogConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; + +@Component +public abstract class ExternalTaskUtils { + + @Autowired + Environment env; + + private static final Logger logger = LoggerFactory.getLogger(ExternalTaskUtils.class); + + public long calculateRetryDelay(int currentRetries) { + int retrySequence = getRetrySequence().length - currentRetries; + return Integer.parseInt(getRetrySequence()[retrySequence]) * getRetryMutiplier(); + } + + protected Long getRetryMutiplier() { + return Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier", "6000")); + } + + protected String[] getRetrySequence() { + String[] seq = {"1", "1", "2", "3", "5", "8", "13", "20"}; + if (env.getProperty("mso.workflow.topics.retrySequence") != null) { + seq = env.getProperty("mso.workflow.topics.retrySequence", String[].class); + } + return seq; + } + + protected void setupMDC(ExternalTask externalTask) { + logger.info(ONAPLogConstants.Markers.ENTRY, "Entering"); + String msoRequestId = externalTask.getVariable("mso-request-id"); + if (msoRequestId != null && !msoRequestId.isEmpty()) { + MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId); + } + MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName()); + } + +} diff --git a/common/src/test/java/org/onap/so/utils/ExternalTaskServiceUtilsTest.java b/common/src/test/java/org/onap/so/utils/ExternalTaskServiceUtilsTest.java new file mode 100644 index 0000000000..b2db986d02 --- /dev/null +++ b/common/src/test/java/org/onap/so/utils/ExternalTaskServiceUtilsTest.java @@ -0,0 +1,61 @@ +package org.onap.so.utils; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.doReturn; +import org.camunda.bpm.client.ExternalTaskClient; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.core.env.Environment; + +@RunWith(MockitoJUnitRunner.class) +public class ExternalTaskServiceUtilsTest { + + @Spy + @InjectMocks + private ExternalTaskServiceUtils utils = new ExternalTaskServiceUtils(); + + @Mock + private Environment mockEnv; + + @Mock + private ExternalTaskClient mockClient; + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + doReturn("3").when(mockEnv).getProperty("workflow.topics.maxClients", "3"); + doReturn("07a7159d3bf51a0e53be7a8f89699be7").when(mockEnv).getRequiredProperty("mso.msoKey"); + doReturn("6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436").when(mockEnv) + .getRequiredProperty("mso.auth"); + doReturn("someid").when(mockEnv).getRequiredProperty("mso.config.cadi.aafId"); + doReturn("http://camunda.com").when(mockEnv).getRequiredProperty("mso.workflow.endpoint"); + } + + @Test + public void testCreateExternalTaskClient() throws Exception { + ExternalTaskClient actualClient = utils.createExternalTaskClient(); + Assert.assertNotNull(actualClient); + } + + @Test + public void testGetAuth() throws Exception { + String actual = utils.getAuth(); + String expected = "Att32054Life!@"; + assertEquals(expected, actual); + } + + @Test + public void testGetMaxClients() throws Exception { + int actual = utils.getMaxClients(); + int expected = 3; + assertEquals(expected, actual); + } + +} diff --git a/common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java b/common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java new file mode 100644 index 0000000000..f918781b39 --- /dev/null +++ b/common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java @@ -0,0 +1,65 @@ +package org.onap.so.utils; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.core.env.Environment; + +@RunWith(MockitoJUnitRunner.class) +public class ExternalTaskUtilsTest { + + @Mock + private Environment mockenv; + + @InjectMocks + private ExternalTaskUtils externalTaskUtilsAnony = new ExternalTaskUtils() { + + }; + + @Test + public void retry_sequence_calculation_Test() { + Mockito.when(mockenv.getProperty("mso.workflow.topics.retryMultiplier", "6000")).thenReturn("6000"); + long firstRetry = externalTaskUtilsAnony.calculateRetryDelay(8); + assertEquals(6000L, firstRetry); + long secondRetry = externalTaskUtilsAnony.calculateRetryDelay(7); + assertEquals(6000L, secondRetry); + long thirdRetry = externalTaskUtilsAnony.calculateRetryDelay(6); + assertEquals(12000L, thirdRetry); + long fourthRetry = externalTaskUtilsAnony.calculateRetryDelay(5); + assertEquals(18000L, fourthRetry); + long fifthRetry = externalTaskUtilsAnony.calculateRetryDelay(4); + assertEquals(30000L, fifthRetry); + long sixRetry = externalTaskUtilsAnony.calculateRetryDelay(3); + assertEquals(48000L, sixRetry); + long seventhRetry = externalTaskUtilsAnony.calculateRetryDelay(2); + assertEquals(78000L, seventhRetry); + long eigthRetry = externalTaskUtilsAnony.calculateRetryDelay(1); + assertEquals(120000L, eigthRetry); + } + + @Test + public void retry_sequence_Test() { + Mockito.when(mockenv.getProperty("mso.workflow.topics.retryMultiplier", "6000")).thenReturn("6000"); + long firstRetry = externalTaskUtilsAnony.calculateRetryDelay(8); + assertEquals(6000L, firstRetry); + long secondRetry = externalTaskUtilsAnony.calculateRetryDelay(7); + assertEquals(6000L, secondRetry); + long thirdRetry = externalTaskUtilsAnony.calculateRetryDelay(6); + assertEquals(12000L, thirdRetry); + long fourthRetry = externalTaskUtilsAnony.calculateRetryDelay(5); + assertEquals(18000L, fourthRetry); + long fifthRetry = externalTaskUtilsAnony.calculateRetryDelay(4); + assertEquals(30000L, fifthRetry); + long sixRetry = externalTaskUtilsAnony.calculateRetryDelay(3); + assertEquals(48000L, sixRetry); + long seventhRetry = externalTaskUtilsAnony.calculateRetryDelay(2); + assertEquals(78000L, seventhRetry); + long eigthRetry = externalTaskUtilsAnony.calculateRetryDelay(1); + assertEquals(120000L, eigthRetry); + } + +} diff --git a/docs/release-notes.rst b/docs/release-notes.rst index cdb20c246b..3b2649361e 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -26,6 +26,7 @@ Version: 1.4.4 - onap/so/sdnc-adapter,1.4.4 - onap/so/so-monitoring,1.4.4 - onap/so/vfc-adapter,1.4.4 + - onap/so/vnfm-adapter,1.4.4 **Release Purpose** @@ -37,7 +38,7 @@ The main goal of the Dublin release was to: - Support BroadBand Service Usecase - SO SOL003 plugin support - Improve PNF PnP - + - Improve SO internal modularity **Epics** @@ -50,7 +51,6 @@ The main goal of the Dublin release was to: - [`SO-1273 <https://jira.onap.org/browse/SO-1273>`__\ ] - PNF PnP Dublin updates & improvements - [`SO-1271 <https://jira.onap.org/browse/SO-1271>`__\ ] - PNF PnP Casablanca MR updates - [`SO-677 <https://jira.onap.org/browse/SO-677>`__\ ] - Improve the issues and findings of the SO Casablanca Release -- [`SO-166 <https://jira.onap.org/browse/SO-166>`__\ ] - Non-stop operations required. **Stories** @@ -220,7 +220,7 @@ The main goal of the Dublin release was to: Testing Terminate and Delete of ETSI VNFM Adapter is done and has some of the minor issues pending, it will be done in El Alto. -- [`SO-1742 <https://jira.onap.org/browse/SO-1742>`__\ ] - Test Terminate/Delete VNF with VNFM Adapter +- [`SO-2013 <https://jira.onap.org/browse/SO-2013>`__\ ] - Test Terminate/Delete VNF with VNFM Adapter **Upgrade Notes** diff --git a/mso-api-handlers/mso-api-handler-infra/pom.xml b/mso-api-handlers/mso-api-handler-infra/pom.xml index a3b9827d9f..bb726e68aa 100644 --- a/mso-api-handlers/mso-api-handler-infra/pom.xml +++ b/mso-api-handlers/mso-api-handler-infra/pom.xml @@ -18,7 +18,7 @@ <camunda.bpm.assert.version>1.2</camunda.bpm.assert.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <swagger-version>1.3.0</swagger-version> + <swagger.version>2.0.8</swagger.version> <jax-rs-version>1.1.1</jax-rs-version> <json4s-jackson-version>3.6.0</json4s-jackson-version> <json4s-core-version>3.6.0</json4s-core-version> @@ -56,10 +56,16 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> + + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-annotations</artifactId> + <version>${swagger.version}</version> + </dependency> <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-jersey2-jaxrs</artifactId> - <version>1.5.16</version> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-jaxrs2</artifactId> + <version>2.0.6</version> </dependency> <dependency> <groupId>com.h2database</groupId> diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java index d3a279fd8e..650922094d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java @@ -76,13 +76,19 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/e2eServiceInstances") -@Api(value = "/onap/so/infra/e2eServiceInstances", description = "API Requests for E2E Service Instances") +@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/e2eServiceInstances", + description = "API Requests for E2E Service Instances")) + public class E2EServiceInstances { private HashMap<String, String> instanceIdMap = new HashMap<>(); @@ -119,7 +125,8 @@ public class E2EServiceInstances { @Path("/{version:[vV][3-5]}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create an E2E Service Instance on a version provided", response = Response.class) + @Operation(description = "Create an E2E Service Instance on a version provided", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response createE2EServiceInstance(String request, @PathParam("version") String version) throws ApiException { return processE2EserviceInstances(request, Action.createInstance, null, version); @@ -135,8 +142,9 @@ public class E2EServiceInstances { @Path("/{version:[vV][3-5]}/{serviceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update an E2E Service Instance on a version provided and serviceId", - response = Response.class) + @Operation(description = "Update an E2E Service Instance on a version provided and serviceId", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response updateE2EServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceId") String serviceId) throws ApiException { @@ -155,7 +163,9 @@ public class E2EServiceInstances { @Path("/{version:[vV][3-5]}/{serviceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class) + @Operation(description = "Delete E2E Service Instance on a specified version and serviceId", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response deleteE2EServiceInstance(String request, @PathParam("version") String version, @PathParam(SERVICE_ID) String serviceId) throws ApiException { @@ -166,8 +176,9 @@ public class E2EServiceInstances { @GET @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}") - @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", - response = Response.class) + @Operation(description = "Find e2eServiceInstances Requests for a given serviceId and operationId", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Produces(MediaType.APPLICATION_JSON) public Response getE2EServiceInstances(@PathParam(SERVICE_ID) String serviceId, @PathParam("version") String version, @PathParam("operationId") String operationId) { @@ -184,7 +195,8 @@ public class E2EServiceInstances { @Path("/{version:[vV][3-5]}/{serviceId}/scale") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Scale E2E Service Instance on a specified version", response = Response.class) + @Operation(description = "Scale E2E Service Instance on a specified version", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response scaleE2EServiceInstance(String request, @PathParam("version") String version, @PathParam(SERVICE_ID) String serviceId) throws ApiException { @@ -203,9 +215,10 @@ public class E2EServiceInstances { @Path("/{version:[vV][3-5]}/{serviceId}/modeldifferences") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ", - response = Response.class) + @Operation( + description = "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response compareModelwithTargetVersion(String request, @PathParam("serviceId") String serviceId, @PathParam("version") String version) throws ApiException { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java index 0379ae3578..5327211280 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java @@ -53,13 +53,18 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/globalhealthcheck") -@Api(value = "/globalhealthcheck", description = "APIH Infra Global Health Check") +@OpenAPIDefinition(info = @Info(title = "/globalhealthcheck", description = "APIH Infra Global Health Check")) public class GlobalHealthcheckHandler { private static Logger logger = LoggerFactory.getLogger(GlobalHealthcheckHandler.class); protected static final String CONTEXTPATH_PROPERTY = "management.endpoints.web.base-path"; @@ -98,7 +103,8 @@ public class GlobalHealthcheckHandler { @GET @Produces("application/json") - @ApiOperation(value = "Performing global health check", response = Response.class) + @Operation(description = "Performing global health check", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response globalHealthcheck(@DefaultValue("true") @QueryParam("enableBpmn") boolean enableBpmn, @Context ContainerRequestContext requestContext) { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java index 15572f2b39..d3bd769386 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java @@ -23,8 +23,6 @@ package org.onap.so.apihandlerinfra; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import org.apache.http.HttpStatus; import org.onap.so.apihandler.common.ErrorNumbers; import org.onap.so.apihandler.common.RequestClientParameter; @@ -61,10 +59,18 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.IOException; import java.util.HashMap; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/instanceManagement") -@Api(value = "/onap/so/infra/instanceManagement", description = "Infrastructure API Requests for Instance Management") +@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/instanceManagement", + description = "Infrastructure API Requests for Instance Management")) public class InstanceManagement { private static Logger logger = LoggerFactory.getLogger(InstanceManagement.class); @@ -87,7 +93,8 @@ public class InstanceManagement { @Path("/{version:[vV][1]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/workflows/{workflowUuid}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Execute custom workflow", response = Response.class) + @Operation(description = "Execute custom workflow", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response executeCustomWorkflow(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java index e162a67680..2703e1edd3 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java @@ -20,8 +20,12 @@ package org.onap.so.apihandlerinfra; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.annotation.PostConstruct; +import javax.servlet.ServletConfig; import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Context; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletProperties; import org.onap.so.apihandler.filters.RequestIdFilter; @@ -42,9 +46,13 @@ import org.onap.so.apihandlerinfra.tenantisolation.ModelDistributionRequest; import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging; import org.onap.so.web.exceptions.RuntimeExceptionMapper; import org.springframework.context.annotation.Configuration; -import io.swagger.jaxrs.config.BeanConfig; -import io.swagger.jaxrs.listing.ApiListingResource; -import io.swagger.jaxrs.listing.SwaggerSerializers; +import io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder; +import io.swagger.v3.jaxrs2.integration.resources.AcceptHeaderOpenApiResource; +import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource; +import io.swagger.v3.oas.integration.OpenApiConfigurationException; +import io.swagger.v3.oas.integration.SwaggerConfiguration; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; @Configuration @ApplicationPath("/") @@ -67,8 +75,8 @@ public class JerseyConfiguration extends ResourceConfig { register(JaxRsFilterLogging.class); register(ManualTasks.class); register(TasksHandler.class); - register(ApiListingResource.class); - register(SwaggerSerializers.class); + register(OpenApiResource.class); + register(AcceptHeaderOpenApiResource.class); register(ApiExceptionMapper.class); register(RuntimeExceptionMapper.class); register(RequestIdFilter.class); @@ -86,12 +94,21 @@ public class JerseyConfiguration extends ResourceConfig { register(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.class); register(ModelDistributionRequest.class); property(ServletProperties.FILTER_FORWARD_ON_404, true); - BeanConfig beanConfig = new BeanConfig(); - beanConfig.setVersion("1.0.2"); - beanConfig.setSchemes(new String[] {"https"}); - beanConfig.setResourcePackage("org.onap.so.apihandlerinfra"); - beanConfig.setPrettyPrint(true); - beanConfig.setScan(true); + + OpenAPI oas = new OpenAPI(); + Info info = new Info(); + info.title("Swagger apihandlerinfra bootstrap code"); + info.setVersion("1.0.2"); + + SwaggerConfiguration oasConfig = new SwaggerConfiguration().openAPI(oas).prettyPrint(true) + .resourcePackages(Stream.of("org.onap.so.apihandlerinfra").collect(Collectors.toSet())); + + try { + new JaxrsOpenApiContextBuilder().application(this).openApiConfiguration(oasConfig).buildContext(true); + } catch (OpenApiConfigurationException e) { + throw new RuntimeException(e.getMessage(), e); + } + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java index b9b7fcc0d4..4bafb40b32 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java @@ -34,7 +34,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.onap.so.logger.LoggingAnchor; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.onap.so.apihandler.common.ErrorNumbers; @@ -52,6 +51,7 @@ import org.onap.so.apihandlerinfra.tasksbeans.Value; import org.onap.so.apihandlerinfra.tasksbeans.Variables; import org.onap.so.exceptions.ValidationException; import org.onap.so.logger.ErrorCode; +import org.onap.so.logger.LoggingAnchor; import org.onap.so.logger.MessageEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,8 +60,11 @@ import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import io.swagger.annotations.ApiOperation; - +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Path("/tasks") @Component @@ -85,7 +88,8 @@ public class ManualTasks { @Path("/{version:[vV]1}/{taskId}/complete") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Complete specified task", response = Response.class) + @Operation(description = "Complete specified task", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response completeTask(String request, @PathParam("version") String version, @PathParam("taskId") String taskId, @Context ContainerRequestContext requestContext) throws ApiException { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java index 3337c62afd..e56ee24baf 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java @@ -22,7 +22,19 @@ package org.onap.so.apihandlerinfra; -import java.net.UnknownHostException; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.apache.http.HttpStatus; +import org.onap.so.logger.LoggingAnchor; +import org.onap.so.logger.MessageEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; import javax.transaction.Transactional; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -30,17 +42,10 @@ import javax.ws.rs.Produces; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; -import org.onap.so.logger.LoggingAnchor; -import org.apache.http.HttpStatus; -import org.onap.so.logger.MessageEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import java.net.UnknownHostException; @Path("/nodehealthcheck") -@Api(value = "/nodehealthcheck", description = "API Handler Infra Node Health Check") +@OpenAPIDefinition(info = @Info(title = "/nodehealthcheck", description = "API Handler Infra Node Health Check")) @Component public class NodeHealthcheckHandler { @@ -53,7 +58,8 @@ public class NodeHealthcheckHandler { @GET @Produces("text/html") - @ApiOperation(value = "Performing node health check", response = Response.class) + @Operation(description = "Performing node health check", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response nodeHealthcheck(@Context ContainerRequestContext requestContext) throws UnknownHostException { // Generated RequestId diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index 8896e93175..b49f9b5a8d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -73,12 +73,19 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Path("onap/so/infra/orchestrationRequests") -@Api(value = "onap/so/infra/orchestrationRequests", description = "API Requests for Orchestration requests") +@OpenAPIDefinition(info = @Info(title = "onap/so/infra/orchestrationRequests", + description = "API Requests for Orchestration requests")) + @Component public class OrchestrationRequests { @@ -99,7 +106,8 @@ public class OrchestrationRequests { @GET @Path("/{version:[vV][4-7]}/{requestId}") - @ApiOperation(value = "Find Orchestrated Requests for a given requestId", response = Response.class) + @Operation(description = "Find Orchestrated Requests for a given requestId", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Produces(MediaType.APPLICATION_JSON) @Transactional public Response getOrchestrationRequest(@PathParam("requestId") String requestId, @@ -164,7 +172,8 @@ public class OrchestrationRequests { @GET @Path("/{version:[vV][4-7]}") - @ApiOperation(value = "Find Orchestrated Requests for a URI Information", response = Response.class) + @Operation(description = "Find Orchestrated Requests for a URI Information", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Produces(MediaType.APPLICATION_JSON) @Transactional public Response getOrchestrationRequest(@Context UriInfo ui, @PathParam("version") String version, @@ -221,7 +230,8 @@ public class OrchestrationRequests { @Path("/{version: [vV][4-7]}/{requestId}/unlock") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Unlock Orchestrated Requests for a given requestId", response = Response.class) + @Operation(description = "Unlock Orchestrated Requests for a given requestId", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId, @PathParam("version") String version) throws ApiException { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java index ed300d95c2..b462415a43 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java @@ -57,11 +57,17 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.HttpClientErrorException; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Path("onap/so/infra/orchestrationRequests") -@Api(value = "onap/so/infra/orchestrationRequests") +@OpenAPIDefinition(info = @Info(title = "onap/so/infra/orchestrationRequests")) + @Component public class ResumeOrchestrationRequest { private static Logger logger = LoggerFactory.getLogger(ResumeOrchestrationRequest.class); @@ -84,7 +90,8 @@ public class ResumeOrchestrationRequest { @Path("/{version:[vV][7]}/{requestId}/resume") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Resume request for a given requestId", response = Response.class) + @Operation(description = "Resume request for a given requestId", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response resumeOrchestrationRequest(@PathParam("requestId") String requestId, @PathParam("version") String version, @Context ContainerRequestContext requestContext) throws ApiException { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java index 9b72bdc608..da101a2e6d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java @@ -89,16 +89,19 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/serviceInstantiation") -@Api(value = "/onap/so/infra/serviceInstantiation", description = "Infrastructure API Requests for Service Instances") +@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/serviceInstantiation", + description = "Infrastructure API Requests for Service Instances")) public class ServiceInstances extends AbstractRestHandler { private static Logger logger = LoggerFactory.getLogger(MsoRequest.class); @@ -132,7 +135,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create a Service Instance on a version provided", response = Response.class) + @Operation(description = "Create a Service Instance on a version provided", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createServiceInstance(String request, @PathParam("version") String version, @Context ContainerRequestContext requestContext) throws ApiException { @@ -145,7 +149,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/activate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Activate provided Service Instance", response = Response.class) + @Operation(description = "Activate provided Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response activateServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -161,7 +166,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/deactivate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Deactivate provided Service Instance", response = Response.class) + @Operation(description = "Deactivate provided Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deactivateServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -177,7 +183,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided Service Instance", response = Response.class) + @Operation(description = "Delete provided Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -193,7 +200,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/serviceInstances/assign") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Assign Service Instance", response = Response.class) + @Operation(description = "Assign Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response assignServiceInstance(String request, @PathParam("version") String version, @Context ContainerRequestContext requestContext) throws ApiException { @@ -206,7 +214,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/unassign") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Unassign Service Instance", response = Response.class) + @Operation(description = "Unassign Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response unassignServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -222,7 +231,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create Port Mirroring Configuration", response = Response.class) + @Operation(description = "Create Port Mirroring Configuration", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createPortConfiguration(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -238,7 +248,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided Port", response = Response.class) + @Operation(description = "Delete provided Port", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deletePortConfiguration(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -256,7 +267,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Enable Port Mirroring", response = Response.class) + @Operation(description = "Enable Port Mirroring", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response enablePort(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -274,7 +286,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Disable Port Mirroring", response = Response.class) + @Operation(description = "Disable Port Mirroring", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response disablePort(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -292,7 +305,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Activate Port Mirroring", response = Response.class) + @Operation(description = "Activate Port Mirroring", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response activatePort(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -310,7 +324,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Deactivate Port Mirroring", response = Response.class) + @Operation(description = "Deactivate Port Mirroring", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deactivatePort(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -328,7 +343,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/addRelationships") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Add Relationships to a Service Instance", response = Response.class) + @Operation(description = "Add Relationships to a Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response addRelationships(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -344,7 +360,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/removeRelationships") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Remove Relationships from Service Instance", response = Response.class) + @Operation(description = "Remove Relationships from Service Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response removeRelationships(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -360,7 +377,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create VNF on a specified version and serviceInstance", response = Response.class) + @Operation(description = "Create VNF on a specified version and serviceInstance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createVnfInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -381,7 +399,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Replace provided VNF instance", response = Response.class) + @Operation(description = "Replace provided VNF instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response replaceVnfInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -398,8 +417,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update VNF on a specified version, serviceInstance and vnfInstance", - response = Response.class) + @Operation(description = "Update VNF on a specified version, serviceInstance and vnfInstance", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response updateVnfInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -416,7 +436,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Apply updated configuration", response = Response.class) + @Operation(description = "Apply updated configuration", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response applyUpdatedConfig(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @Context ContainerRequestContext requestContext) throws ApiException { @@ -432,7 +453,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/recreate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Recreate VNF Instance", response = Response.class) + @Operation(description = "Recreate VNF Instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) public Response recreateVnfInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @Context ContainerRequestContext requestContext) throws ApiException { @@ -448,7 +470,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided VNF instance", response = Response.class) + @Operation(description = "Delete provided VNF instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteVnfInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -465,8 +488,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create VfModule on a specified version, serviceInstance and vnfInstance", - response = Response.class) + @Operation(description = "Create VfModule on a specified version, serviceInstance and vnfInstance", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createVfModuleInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -483,8 +507,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create VfModule on a specified version, serviceInstance and vnfInstance", - response = Response.class) + @Operation(description = "Create VfModule on a specified version, serviceInstance and vnfInstance", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response replaceVfModuleInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -503,8 +528,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update VfModule on a specified version, serviceInstance, vnfInstance and vfModule", - response = Response.class) + @Operation(description = "Update VfModule on a specified version, serviceInstance, vnfInstance and vfModule", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response updateVfModuleInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -523,7 +549,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Perform VNF software update", response = Response.class) + @Operation(description = "Perform VNF software update", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response inPlaceSoftwareUpdate(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -540,7 +567,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided VfModule instance", response = Response.class) + @Operation(description = "Delete provided VfModule instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteVfModuleInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -559,7 +587,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Deactivate and Cloud Delete VfModule instance", response = Response.class) + @Operation(description = "Deactivate and Cloud Delete VfModule instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deactivateAndCloudDeleteVfModuleInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -579,7 +608,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "VF Auto Scale Out", response = Response.class) + @Operation(description = "VF Auto Scale Out", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response scaleOutVfModule(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -596,8 +626,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create VolumeGroup on a specified version, serviceInstance, vnfInstance", - response = Response.class) + @Operation(description = "Create VolumeGroup on a specified version, serviceInstance, vnfInstance", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createVolumeGroupInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -614,8 +645,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update VolumeGroup on a specified version, serviceInstance, vnfInstance and volumeGroup", - response = Response.class) + @Operation(description = "Update VolumeGroup on a specified version, serviceInstance, vnfInstance and volumeGroup", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response updateVolumeGroupInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -634,7 +666,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided VolumeGroup instance", response = Response.class) + @Operation(description = "Delete provided VolumeGroup instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteVolumeGroupInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, @@ -653,8 +686,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create NetworkInstance on a specified version and serviceInstance ", - response = Response.class) + @Operation(description = "Create NetworkInstance on a specified version and serviceInstance ", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createNetworkInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) @@ -670,8 +704,9 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update VolumeGroup on a specified version, serviceInstance, networkInstance", - response = Response.class) + @Operation(description = "Update VolumeGroup on a specified version, serviceInstance, networkInstance", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response updateNetworkInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -689,7 +724,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided Network instance", response = Response.class) + @Operation(description = "Delete provided Network instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteNetworkInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @@ -707,7 +743,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/instanceGroups") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create instanceGroups", response = Response.class) + @Operation(description = "Create instanceGroups", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createInstanceGroups(String request, @PathParam("version") String version, @Context ContainerRequestContext requestContext) throws ApiException { @@ -720,7 +757,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/instanceGroups/{instanceGroupId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete instanceGroup", response = Response.class) + @Operation(description = "Delete instanceGroup", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteInstanceGroups(@PathParam("version") String version, @PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext) @@ -736,7 +774,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/instanceGroups/{instanceGroupId}/addMembers") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Add instanceGroup members", response = Response.class) + @Operation(description = "Add instanceGroup members", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response addInstanceGroupMembers(String request, @PathParam("version") String version, @PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext) @@ -752,7 +791,8 @@ public class ServiceInstances extends AbstractRestHandler { @Path("/{version:[vV][7]}/instanceGroups/{instanceGroupId}/removeMembers") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Remove instanceGroup members", response = Response.class) + @Operation(description = "Remove instanceGroup members", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response removeInstanceGroupMembers(String request, @PathParam("version") String version, @PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext) diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java index 3c4c90cc37..09a1d9e5a6 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java @@ -36,7 +36,6 @@ import javax.ws.rs.core.UriBuilder; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.json.JSONArray; -import org.json.JSONException; import org.json.JSONObject; import org.onap.so.apihandler.common.ErrorNumbers; import org.onap.so.apihandler.common.RequestClient; @@ -60,11 +59,16 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Path("onap/so/infra/tasks") -@Api(value = "onap/so/infra/tasks", description = "Queries of Manual Tasks") +@OpenAPIDefinition(info = @Info(title = "onap/so/infra/tasks", description = "Queries of Manual Tasks")) @Component public class TasksHandler { @@ -82,7 +86,8 @@ public class TasksHandler { @Path("/{version:[vV]1}") @GET - @ApiOperation(value = "Finds Manual Tasks", response = Response.class) + @Operation(description = "Finds Manual Tasks", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response queryFilters(@QueryParam("taskId") String taskId, @QueryParam("originalRequestId") String originalRequestId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java index b57bb5d1d8..925d10179f 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java @@ -59,11 +59,17 @@ import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Path("onap/so/infra/workflowSpecifications") -@Api(value = "onap/so/infra/workflowSpecifications", description = "Queries of Workflow Specifications") +@OpenAPIDefinition(info = @Info(title = "onap/so/infra/workflowSpecifications", + description = "Queries of Workflow Specifications")) @Component public class WorkflowSpecificationsHandler { @@ -79,7 +85,8 @@ public class WorkflowSpecificationsHandler { @Path("/{version:[vV]1}/workflows") @GET - @ApiOperation(value = "Finds Workflow Specifications", response = Response.class) + @Operation(description = "Finds Workflow Specifications", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response queryWorkflowSpecifications(@QueryParam("vnfModelVersionId") String vnfModelVersionId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java index ec3df21fdb..483ac47235 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java @@ -44,7 +44,11 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/serviceInstantiation") @@ -61,7 +65,8 @@ public class Network { @Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete provided Network instance", response = Response.class) + @Operation(description = "Delete provided Network instance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deleteNetworkInstance(@PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java index 07e8092449..135667d3e4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java @@ -44,7 +44,11 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/serviceInstantiation") @@ -61,7 +65,8 @@ public class ServiceInstance { @Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete a Service instance", response = ServiceInstancesResponse.class) + @Operation(description = "Delete a Service instance", responses = @ApiResponse(content = @Content( + array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class))))) @Transactional public Response deleteServiceInstance(@PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java index 1b9eb1f802..4a86d944cf 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java @@ -45,7 +45,11 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/serviceInstantiation") @@ -62,7 +66,8 @@ public class VfModules { @Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete a VfModule instance", response = ServiceInstancesResponse.class) + @Operation(description = "Delete a VfModule instance", responses = @ApiResponse(content = @Content( + array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class))))) @Transactional public Response deleteVfModuleInstance(@PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java index a8ccdeecac..edb09083d4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java @@ -43,7 +43,11 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/serviceInstantiation") @@ -60,7 +64,8 @@ public class Vnf { @Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete a Vnf instance", response = ServiceInstancesResponse.class) + @Operation(description = "Delete a Vnf instance", responses = @ApiResponse(content = @Content( + array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class))))) @Transactional public Response deleteVnfInstance(@PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java index d3e394d6d8..3154c86046 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java @@ -46,7 +46,11 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component("VolumesV8") @Path("/onap/so/infra/serviceInstantiation") @@ -66,7 +70,8 @@ public class Volumes { @Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete a VfModule instance", response = ServiceInstancesResponse.class) + @Operation(description = "Delete a VfModule instance", responses = @ApiResponse(content = @Content( + array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class))))) @Transactional public Response deleteVfModuleInstance(@PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java index d3fb7986ce..877376cc79 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java @@ -61,12 +61,18 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/cloudResources") -@Api(value = "/onap/so/infra/cloudResources", description = "API Requests for cloud resources - Tenant Isolation") +@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/cloudResources", + description = "API Requests for cloud resources - Tenant Isolation")) public class CloudOrchestration { private static Logger logger = LoggerFactory.getLogger(CloudOrchestration.class); @@ -85,7 +91,8 @@ public class CloudOrchestration { @Path("/{version:[vV][1]}/operationalEnvironments") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create an Operational Environment", response = Response.class) + @Operation(description = "Create an Operational Environment", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response createOperationEnvironment(String request, @PathParam("version") String version, @Context ContainerRequestContext requestContext) throws ApiException { @@ -97,7 +104,8 @@ public class CloudOrchestration { @Path("/{version:[vV][1]}/operationalEnvironments/{operationalEnvironmentId}/activate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Activate an Operational Environment", response = Response.class) + @Operation(description = "Activate an Operational Environment", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response activateOperationEnvironment(String request, @PathParam("version") String version, @PathParam("operationalEnvironmentId") String operationalEnvironmentId, @@ -112,7 +120,8 @@ public class CloudOrchestration { @Path("/{version:[vV][1]}/operationalEnvironments/{operationalEnvironmentId}/deactivate") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Deactivate an Operational Environment", response = Response.class) + @Operation(description = "Deactivate an Operational Environment", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response deactivateOperationEnvironment(String request, @PathParam("version") String version, @PathParam("operationalEnvironmentId") String operationalEnvironmentId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java index e9cd303c0b..47d6932730 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java @@ -62,13 +62,18 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("onap/so/infra/cloudResourcesRequests") -@Api(value = "onap/so/infra/cloudResourcesRequests", - description = "API GET Requests for cloud resources - Tenant Isolation") +@OpenAPIDefinition(info = @Info(title = "onap/so/infra/cloudResourcesRequests", + description = "API GET Requests for cloud resources - Tenant Isolation")) public class CloudResourcesOrchestration { private static Logger logger = LoggerFactory.getLogger(CloudResourcesOrchestration.class); @@ -83,7 +88,7 @@ public class CloudResourcesOrchestration { @Path("/{version: [vV][1]}/{requestId}/unlock") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Unlock CloudOrchestration requests for a specified requestId") + @Operation(description = "Unlock CloudOrchestration requests for a specified requestId") @Transactional public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId, @PathParam("version") String version) throws ApiException { @@ -167,8 +172,9 @@ public class CloudResourcesOrchestration { @Path("/{version:[vV][1]}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Get status of an Operational Environment based on filter criteria", - response = Response.class) + @Operation(description = "Get status of an Operational Environment based on filter criteria", + responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response getOperationEnvironmentStatusFilter(@Context UriInfo ui, @PathParam("version") String version) throws ApiException { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java index ef5abe9f74..2f922220c9 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java @@ -55,12 +55,18 @@ import org.springframework.stereotype.Component; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; @Component @Path("/onap/so/infra/modelDistributions") -@Api(value = "/onap/so/infra/modelDistributions", description = "API Requests for Model Distributions") +@OpenAPIDefinition( + info = @Info(title = "/onap/so/infra/modelDistributions", description = "API Requests for Model Distributions")) public class ModelDistributionRequest { private static Logger logger = LoggerFactory.getLogger(ModelDistributionRequest.class); @@ -71,7 +77,8 @@ public class ModelDistributionRequest { @Path("/{version:[vV][1]}/distributions/{distributionId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update model distribution status", response = Response.class) + @Operation(description = "Update model distribution status", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) @Transactional public Response updateModelDistributionStatus(String requestJSON, @PathParam("version") String version, @PathParam("distributionId") String distributionId) throws ApiException { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql index 6d8e2e8b09..d5575804ae 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql @@ -1,10 +1,10 @@ -INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES +INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00032ab7-na18-42e5-965d-8ea592502018', '00032ab7-fake-42e5-965d-8ea592502018', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_v10_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"Infra_v10_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_v10_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_v10_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('5ffbabd6-b793-4377-a1ab-082670fbc7ac', '5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo": {"modelType": "vfModule","modelName": "test::base::module-0","modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671","modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671","modelVersion": "2","modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"},"cloudConfiguration": {"lcpCloudRegionId": "n6","tenantId": "0422ffb57ba042c0800a29dc85ca70f8"},"requestInfo": {"instanceName": "MSO-DEV-VF-1806BB-v10-base-it2-1","source": "VID","suppressRollback": false,"requestorId": "xxxxxx"},"relatedInstanceList": [{"relatedInstance": {"instanceId": "76fa8849-4c98-473f-b431-2590b192a653","modelInfo": {"modelType": "service","modelName": "Infra_v10_Service","modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671","modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671","modelVersion": "1.0"}}},{"relatedInstance": {"instanceId": "d57970e1-5075-48a5-ac5e-75f2d6e10f4c","modelInfo": {"modelType": "vnf","modelName": "v10","modelVersionId": "ff2ae348-214a-11e7-93ae-92361f002671","modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671","modelVersion": "1.0","modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671","modelCustomizationName": "v10 1"}}}],"requestParameters": {"usePreload": true,"userParams": []}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'); -INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES +INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-n6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-n6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"Infra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql index 22f68e0579..72922ae9c1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql @@ -1,12 +1,12 @@ --Changes here should also be made in InfraActiveRequestsReset.sql to be re-inserted after tests -INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES +INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00032ab7-na18-42e5-965d-8ea592502018', '00032ab7-fake-42e5-965d-8ea592502018', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, null), ('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_v10_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"Infra_v10_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_v10_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_v10_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('5ffbabd6-b793-4377-a1ab-082670fbc7ac', '5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo": {"modelType": "vfModule","modelName": "test::base::module-0","modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671","modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671","modelVersion": "2","modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"},"cloudConfiguration": {"lcpCloudRegionId": "n6","tenantId": "0422ffb57ba042c0800a29dc85ca70f8"},"requestInfo": {"instanceName": "MSO-DEV-VF-1806BB-v10-base-it2-1","source": "VID","suppressRollback": false,"requestorId": "xxxxxx"},"relatedInstanceList": [{"relatedInstance": {"instanceId": "76fa8849-4c98-473f-b431-2590b192a653","modelInfo": {"modelType": "service","modelName": "Infra_v10_Service","modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671","modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671","modelVersion": "1.0"}}},{"relatedInstance": {"instanceId": "d57970e1-5075-48a5-ac5e-75f2d6e10f4c","modelInfo": {"modelType": "vnf","modelName": "v10","modelVersionId": "ff2ae348-214a-11e7-93ae-92361f002671","modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671","modelVersion": "1.0","modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671","modelCustomizationName": "v10 1"}}}],"requestParameters": {"usePreload": true,"userParams": []}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'); -INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES +INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-n6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-n6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, null), ('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"Infra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql index ee53e491a4..2129dc2ede 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql @@ -1276,7 +1276,7 @@ CREATE TABLE `infra_active_requests` ( `VF_MODULE_NAME` varchar(200) DEFAULT NULL, `VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL, `AAI_SERVICE_ID` varchar(50) DEFAULT NULL, - `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL, + `CLOUD_REGION` varchar(11) DEFAULT NULL, `CALLBACK_URL` varchar(200) DEFAULT NULL, `CORRELATOR` varchar(80) DEFAULT NULL, `NETWORK_ID` varchar(45) DEFAULT NULL, @@ -1329,7 +1329,7 @@ CREATE TABLE `archived_infra_requests` ( `VF_MODULE_NAME` varchar(200) DEFAULT NULL, `VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL, `AAI_SERVICE_ID` varchar(50) DEFAULT NULL, - `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL, + `CLOUD_REGION` varchar(11) DEFAULT NULL, `CALLBACK_URL` varchar(200) DEFAULT NULL, `CORRELATOR` varchar(80) DEFAULT NULL, `NETWORK_ID` varchar(45) DEFAULT NULL, diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql index 43571e42fc..bfd3d2160a 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql @@ -4,7 +4,7 @@ insert into operation_status(service_id, operation_id, service_name, user_id, re ('serviceid', 'operationid', 'servicename', 'userid', 'result', 'operationcontent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10'); -insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, aic_cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values +insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values ('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql index 192e6d55b6..22e84344f7 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql @@ -79,7 +79,7 @@ CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS( VF_MODULE_NAME VARCHAR SELECTIVITY 8, VF_MODULE_MODEL_NAME VARCHAR SELECTIVITY 3, AAI_SERVICE_ID VARCHAR SELECTIVITY 1, - AIC_CLOUD_REGION VARCHAR SELECTIVITY 1, + CLOUD_REGION VARCHAR SELECTIVITY 1, CALLBACK_URL VARCHAR SELECTIVITY 1, CORRELATOR VARCHAR SELECTIVITY 1, NETWORK_ID VARCHAR SELECTIVITY 2, @@ -102,11 +102,11 @@ CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS( ROLLBACK_EXT_SYSTEM_ERROR_SOURCE VARCHAR SELECTIVITY 1 ); -INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES +INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, STRINGDECODE('<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n'), 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'); -INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES +INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'md5621', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'); @@ -151,7 +151,7 @@ CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS( VF_MODULE_NAME VARCHAR SELECTIVITY 8, VF_MODULE_MODEL_NAME VARCHAR SELECTIVITY 3, AAI_SERVICE_ID VARCHAR SELECTIVITY 1, - AIC_CLOUD_REGION VARCHAR SELECTIVITY 1, + CLOUD_REGION VARCHAR SELECTIVITY 1, CALLBACK_URL VARCHAR SELECTIVITY 1, CORRELATOR VARCHAR SELECTIVITY 1, NETWORK_ID VARCHAR SELECTIVITY 2, diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java index 05845dd058..73e5e16324 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java @@ -117,7 +117,7 @@ public abstract class InfraRequests implements java.io.Serializable { private String vfModuleModelName; @Column(name = "AAI_SERVICE_ID", length = 50) private String aaiServiceId; - @Column(name = "AIC_CLOUD_REGION", length = 11) + @Column(name = "CLOUD_REGION", length = 11) private String aicCloudRegion; @Column(name = "CALLBACK_URL", length = 200) private String callBackUrl; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java index 425e0b8bbc..ac0d09b13b 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java @@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder; @IdClass(ControllerSelectionReferenceId.class) @Entity -@Table(name = "CONTROLLER_SELECTION_REFERENCE") +@Table(name = "controller_selection_reference") public class ControllerSelectionReference implements Serializable { private static final long serialVersionUID = -608098800737567188L; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java index 93e2992d3f..9691eff5f5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java @@ -22,6 +22,7 @@ package org.onap.so.db.catalog.beans; public enum OrchestrationStatus { ACTIVE("Active", "active"), + ACTIVATED("Activated", "activated"), ASSIGNED("Assigned", "assigned"), CREATED("Created", "created"), INVENTORIED("Inventoried", "inventoried"), diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java index c2cf2d7cf6..9ec61ff05f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java @@ -17,7 +17,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import com.openpojo.business.annotation.BusinessKey; @Entity -@Table(name = "USER_PARAMETERS") +@Table(name = "user_parameters") public class UserParameters implements Serializable { private static final long serialVersionUID = -5036895978102778877L; |