summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.2__ScaleOutRecipe.sql5
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java122
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java52
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/application.yaml4
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java146
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java3
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java25
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java244
-rw-r--r--adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml2
-rw-r--r--adapters/mso-vnf-adapter/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java158
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy96
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy52
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceInstance.java19
-rw-r--r--bpmn/mso-infrastructure-bpmn/pom.xml5
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java16
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy89
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy194
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy177
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy194
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy13
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy8
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy25
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java68
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn266
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn266
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn86
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/BaseClient.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/BaseClientTest.java50
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json4
-rw-r--r--common/pom.xml5
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestDetails.java22
-rw-r--r--docs/Install_Configure_SO.rst18
-rw-r--r--docs/api/SO_Interface.rst (renamed from docs/SO_Interface.rst)2
-rw-r--r--docs/architecture/architecture.rst (renamed from docs/architecture.rst)218
-rw-r--r--docs/bpmn/BPMN_Main_Process_Flows.rst (renamed from docs/BPMN_Main_Process_Flows.rst)78
-rw-r--r--docs/bpmn/BPMN_Project_Deployment_Strategy.rst (renamed from docs/BPMN_Project_Deployment_Strategy.rst)0
-rw-r--r--docs/bpmn/BPMN_Project_Structure.rst (renamed from docs/BPMN_Project_Structure.rst)92
-rw-r--r--docs/bpmn/BPMN_Subprocess_Process_Flows.rst (renamed from docs/BPMN_Subprocess_Process_Flows.rst)64
-rw-r--r--docs/bpmn/Camunda_Cockpit_Community_Edition.rst (renamed from docs/Camunda_Cockpit_Community_Edition.rst)0
-rw-r--r--docs/bpmn/Camunda_Cockpit_Enterprise_Edition.rst (renamed from docs/Camunda_Cockpit_Enterprise_Edition.rst)0
-rw-r--r--docs/bpmn/Camunda_Modeler.rst (renamed from docs/Camunda_Modeler.rst)36
-rw-r--r--docs/index.rst4
-rw-r--r--docs/installconfigure/Configure_git_and_gerrit.rst (renamed from docs/Configure_git_and_gerrit.rst)0
-rw-r--r--docs/installconfigure/Install_Docker.rst (renamed from docs/Install_Docker.rst)168
-rw-r--r--docs/installconfigure/Workspace_and_Development_Tools.rst (renamed from docs/Workspace_and_Development_Tools.rst)212
-rw-r--r--docs/offered_consumed_apis.rst2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java15
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java39
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ConfigurationParametersValidation.java49
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java14
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java12
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java22
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/ScaleOutNoCloudConfig.json50
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ConfigurationParameters/NoConfigurationParameters.json54
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelCustomizationId.json53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelInvariantId.json53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelName.json53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersion.json53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionId.json53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionVersion.json53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RelatedInstances/ScaleOutNoRelatedInstances.json34
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestInfo/ScaleOutNoRequestInfo.json48
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ScaleOutRequest.json71
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql7
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java416
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepository.java10
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepositoryTest.java21
-rw-r--r--packages/docker/pom.xml20
-rw-r--r--packages/docker/src/main/docker/docker-files/Dockerfile.so-app2
-rw-r--r--packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml3
88 files changed, 3447 insertions, 1154 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.2__ScaleOutRecipe.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.2__ScaleOutRecipe.sql
new file mode 100644
index 0000000000..b3d8b98176
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.2__ScaleOutRecipe.sql
@@ -0,0 +1,5 @@
+use catalogdb;
+
+INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_MODEL_UUID)
+VALUES
+('vfModule', 'scaleOut', '1', 'Gr api recipe to scale out vfModule', '/mso/async/services/WorkflowActionBB', '180', 'GR-API-DEFAULT');
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java
new file mode 100644
index 0000000000..9ed61b33a3
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java
@@ -0,0 +1,122 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.catalogdb.catalogrest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import java.net.URI;
+import java.util.List;
+
+import javax.transaction.Transactional;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.adapters.catalogdb.CatalogDBApplication;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.BuildingBlockDetail;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.InstanceGroup;
+import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
+import org.onap.so.db.catalog.beans.ServerType;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.logger.MsoLogger;
+import org.onap.so.logging.jaxrs.filter.jersey.SpringClientFilter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.web.util.UriComponentsBuilder;
+import uk.co.blackpepper.bowman.Client;
+import uk.co.blackpepper.bowman.ClientFactory;
+import uk.co.blackpepper.bowman.Configuration;
+import static com.shazam.shazamcrest.MatcherAssert.assertThat;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = CatalogDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class CloudConfigTest {
+
+ protected TestRestTemplate restTemplate = new TestRestTemplate("test", "test");
+
+ protected HttpHeaders headers = new HttpHeaders();
+
+ @LocalServerPort
+ private int port;
+
+ @Test
+ @Transactional
+ public void createCloudSiteRest_TEST() {
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type",MediaType.APPLICATION_JSON);
+
+ CloudSite cloudSite = new CloudSite();
+ cloudSite.setId("MTN6");
+ cloudSite.setClli("TESTCLLI");
+ cloudSite.setRegionId("regionId");
+ cloudSite.setCloudVersion("VERSION");
+ cloudSite.setPlatform("PLATFORM");
+
+ CloudIdentity cloudIdentity = new CloudIdentity();
+ cloudIdentity.setId("RANDOMID");
+ cloudIdentity.setIdentityUrl("URL");
+ cloudIdentity.setMsoId("MSO_ID");
+ cloudIdentity.setMsoPass("MSO_PASS");
+ cloudIdentity.setAdminTenant("ADMIN_TENANT");
+ cloudIdentity.setMemberRole("ROLE");
+ cloudIdentity.setIdentityServerType(ServerType.KEYSTONE);
+ cloudIdentity.setIdentityAuthenticationType(AuthenticationType.RACKSPACE_APIKEY);
+ cloudSite.setIdentityService(cloudIdentity);
+ String uri = "/cloudSite";
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:"+ port + uri);
+ HttpEntity<CloudSite> request = new HttpEntity<CloudSite>(cloudSite, headers);
+ ResponseEntity<String> response = restTemplate.exchange(builder.toUriString(),
+ HttpMethod.POST, request, String.class);
+ assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusCode().value());
+
+ builder = UriComponentsBuilder.fromHttpUrl("http://localhost:"+ port + uri +"/" + cloudSite.getId());
+ HttpEntity<String> entity = new HttpEntity<String>(null, headers);
+ ResponseEntity<CloudSite> actualCloudSite = restTemplate.exchange(builder.toUriString(),HttpMethod.GET, entity, CloudSite.class);
+
+ assertEquals(Response.Status.OK.getStatusCode(), actualCloudSite.getStatusCode().value());
+ assertThat(actualCloudSite.getBody(), sameBeanAs(cloudSite).ignoring("created").ignoring("updated")
+ .ignoring("identityService.created").ignoring("identityService.updated"));
+
+ }
+
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
index fd2ec179dc..ed64abd982 100644
--- a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
+++ b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
@@ -13,6 +13,8 @@ import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.CloudifyManager;
import org.onap.so.logger.MsoLogger;
+import java.io.FileInputStream;
+import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -33,10 +35,31 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
@Override
public void migrate(Connection connection) throws Exception {
LOGGER.debug("Starting migration for CloudConfig");
- CloudConfig cloudConfig = loadCloudConfig();
- if(cloudConfig == null){
- LOGGER.debug("No CloudConfig defined in :"+getApplicationYamlName()+" exiting.");
- }else{
+
+ CloudConfig cloudConfig = null;
+
+ // Try the override file
+ String configLocation = System.getProperty("spring.config.location");
+ if (configLocation != null) {
+ try (InputStream stream = new FileInputStream(configLocation)) {
+ cloudConfig = loadCloudConfig(stream);
+ }
+ }
+
+ if (cloudConfig == null) {
+ LOGGER.debug("No CloudConfig defined in " + configLocation);
+
+ // Try the application.yaml file
+ try (InputStream stream = R__CloudConfigMigration.class.getResourceAsStream(getApplicationYamlName())) {
+ cloudConfig = loadCloudConfig(stream);
+ }
+
+ if (cloudConfig == null) {
+ LOGGER.debug("No CloudConfig defined in " + getApplicationYamlName());
+ }
+ }
+
+ if(cloudConfig != null){
migrateCloudIdentity(cloudConfig.getIdentityServices().values(), connection);
migrateCloudSite(cloudConfig.getCloudSites().values(), connection);
migrateCloudifyManagers(cloudConfig.getCloudifyManagers().values(), connection);
@@ -51,13 +74,14 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
this.cloudConfig = cloudConfig;
}
- private CloudConfig loadCloudConfig() throws Exception {
+ private CloudConfig loadCloudConfig(InputStream stream) throws Exception {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
- R__CloudConfigMigration cloudConfigMigration = mapper.readValue(R__CloudConfigMigration.class
- .getResourceAsStream(getApplicationYamlName()), R__CloudConfigMigration.class);
+ R__CloudConfigMigration cloudConfigMigration =
+ mapper.readValue(stream, R__CloudConfigMigration.class);
CloudConfig cloudConfig = cloudConfigMigration.getCloudConfig();
+
if(cloudConfig != null){
- cloudConfig.populateId();
+ cloudConfig.populateId();
}
return cloudConfig;
@@ -72,8 +96,8 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
LOGGER.debug("Starting migration for CloudConfig-->IdentityService");
String insert = "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`) " +
"VALUES (?,?,?,?,?,?,?,?,?,?);";
- PreparedStatement ps = connection.prepareStatement(insert);
- try (Statement stmt = connection.createStatement()) {
+
+ try (Statement stmt = connection.createStatement();PreparedStatement ps = connection.prepareStatement(insert)) {
for (CloudIdentity cloudIdentity : entities) {
try (ResultSet rows = stmt.executeQuery("Select count(1) from identity_services where id='" + cloudIdentity.getId() + "'")) {
int count = 0;
@@ -102,8 +126,8 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
LOGGER.debug("Starting migration for CloudConfig-->CloudSite");
String insert = "INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`) " +
"VALUES (?,?,?,?,?,?,?,?,?);";
- PreparedStatement ps = connection.prepareStatement(insert);
- try (Statement stmt = connection.createStatement()) {
+
+ try (Statement stmt = connection.createStatement();PreparedStatement ps = connection.prepareStatement(insert)) {
for (CloudSite cloudSite : entities) {
try (ResultSet rows = stmt.executeQuery("Select count(1) from cloud_sites where id='" + cloudSite.getId() + "'")) {
int count = 0;
@@ -130,8 +154,8 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
private void migrateCloudifyManagers(Collection<CloudifyManager> entities, Connection connection) throws Exception {
String insert = "INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `VERSION`, `LAST_UPDATED_BY`)" +
" VALUES (?,?,?,?,?,?);";
- PreparedStatement ps = connection.prepareStatement(insert);
- try (Statement stmt = connection.createStatement()) {
+
+ try (Statement stmt = connection.createStatement();PreparedStatement ps = connection.prepareStatement(insert)) {
for (CloudifyManager cloudifyManager : entities) {
try (ResultSet rows = stmt.executeQuery("Select count(1) from cloudify_managers where id='" + cloudifyManager.getId() + "'")) {
int count = 0;
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application.yaml b/adapters/mso-openstack-adapters/src/main/resources/application.yaml
index 4a4c83e4a5..4b2cf8eb60 100644
--- a/adapters/mso-openstack-adapters/src/main/resources/application.yaml
+++ b/adapters/mso-openstack-adapters/src/main/resources/application.yaml
@@ -41,4 +41,6 @@ management:
flyway:
outOfOrder: true
- ignoreMissingMigrations: true \ No newline at end of file
+ ignoreMissingMigrations: true
+ baseline-on-migrate: true
+ validate-on-migrate: false
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java
new file mode 100644
index 0000000000..c982f8beb1
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java
@@ -0,0 +1,146 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Nokia
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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.vdu.mapper;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.google.common.collect.Lists;
+import java.util.List;
+import org.junit.Test;
+import org.onap.so.adapters.vdu.VduArtifact;
+import org.onap.so.adapters.vdu.VduArtifact.ArtifactType;
+import org.onap.so.adapters.vdu.VduModelInfo;
+import org.onap.so.db.catalog.beans.HeatEnvironment;
+import org.onap.so.db.catalog.beans.HeatFiles;
+import org.onap.so.db.catalog.beans.HeatTemplate;
+import org.onap.so.db.catalog.beans.VfModule;
+import org.onap.so.db.catalog.beans.VfModuleCustomization;
+
+public class VfModuleCustomizationToVduMapperTest {
+
+ private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUUID";
+ private static final String HEAT_ENV_NAME = "heatEnvName";
+ private static final String HEAT_ENV_CONTENT = "heatEnvContent";
+ private static final String MODULE_HEAT_TEMPLATE_NAME = "moduleHeatTemplateName";
+ private static final String MODULE_HEAT_TEMPLATE_BODY = "moduleHeatTemplateBody";
+ private static final String NESTED_TEMPLATE_NAME = "nestedTemplateName";
+ private static final String NESTED_TEMPLATE_BODY = "nestedTemplateBody";
+ private static final int TIMEOUT_IN_MIN = 66;
+ private static final String VF_MODULE_MODEL_INVARIANT_UUID = "vfModuleModelInvariantUUID";
+ private static final String CLOUD_FILE_NAME = "cloudFileName";
+ private static final String CLOUD_FILE_BODY = "cloudFileBody";
+
+
+ @Test
+ public void mapVfModuleCustomizationToVdu_successful() {
+ // GIVEN
+ VfModuleCustomization vfModuleCustomization = createVfModuleCustomization();
+ vfModuleCustomization.setHeatEnvironment(createHeatEnvironment(HEAT_ENV_NAME, HEAT_ENV_CONTENT));
+ VfModule vfModule = createVfModule();
+ vfModule.setModuleHeatTemplate(createHeatTemplate(
+ MODULE_HEAT_TEMPLATE_NAME, MODULE_HEAT_TEMPLATE_BODY,
+ NESTED_TEMPLATE_NAME, NESTED_TEMPLATE_BODY));
+ vfModuleCustomization.setVfModule(vfModule);
+
+ // WHEN
+ VduModelInfo vduModelInfo = new VfModuleCustomizationToVduMapper()
+ .mapVfModuleCustomizationToVdu(vfModuleCustomization);
+
+ // THEN
+ assertThat(vduModelInfo.getModelCustomizationUUID()).isEqualTo(MODEL_CUSTOMIZATION_UUID);
+ assertThat(vduModelInfo.getTimeoutMinutes()).isEqualTo(TIMEOUT_IN_MIN);
+ assertThat(vduModelInfo.getArtifacts()).containsExactlyElementsOf(createExpectedVduArtifacts());
+ }
+
+ @Test
+ public void mapVfModuleCustVolumeToVdu_successful() {
+ // GIVEN
+ VfModuleCustomization vfModuleCustomization = createVfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(createHeatEnvironment(HEAT_ENV_NAME, HEAT_ENV_CONTENT));
+ VfModule vfModule = createVfModule();
+ vfModule.setVolumeHeatTemplate(createHeatTemplate(
+ MODULE_HEAT_TEMPLATE_NAME, MODULE_HEAT_TEMPLATE_BODY,
+ NESTED_TEMPLATE_NAME, NESTED_TEMPLATE_BODY));
+ vfModuleCustomization.setVfModule(vfModule);
+
+ // WHEN
+ VduModelInfo vduModelInfo = new VfModuleCustomizationToVduMapper()
+ .mapVfModuleCustVolumeToVdu(vfModuleCustomization);
+
+ // THEN
+ assertThat(vduModelInfo.getModelCustomizationUUID()).isEqualTo(MODEL_CUSTOMIZATION_UUID);
+ assertThat(vduModelInfo.getTimeoutMinutes()).isEqualTo(TIMEOUT_IN_MIN);
+ assertThat(vduModelInfo.getArtifacts()).containsExactlyElementsOf(createExpectedVduArtifacts());
+ }
+
+ private VfModuleCustomization createVfModuleCustomization() {
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
+ return vfModuleCustomization;
+ }
+
+ private HeatEnvironment createHeatEnvironment(String volHeatEnvName, String volHeatEnvContent) {
+ HeatEnvironment heatEnvironment = new HeatEnvironment();
+ heatEnvironment.setName(volHeatEnvName);
+ heatEnvironment.setEnvironment(volHeatEnvContent);
+ return heatEnvironment;
+ }
+
+ private VfModule createVfModule() {
+ VfModule vfModule = new VfModule();
+ vfModule.setModelInvariantUUID(VF_MODULE_MODEL_INVARIANT_UUID);
+ vfModule.setHeatFiles(createHeatFiles(CLOUD_FILE_NAME, CLOUD_FILE_BODY));
+ return vfModule;
+ }
+
+ private List<HeatFiles> createHeatFiles(String fileName, String fileBody) {
+ HeatFiles heatFiles = new HeatFiles();
+ heatFiles.setFileName(fileName);
+ heatFiles.setFileBody(fileBody);
+ return Lists.newArrayList(heatFiles);
+ }
+
+ private HeatTemplate createHeatTemplate(String moduleHeatTemplateName, String moduleHeatTemplateBody,
+ String childTemplateName, String childTemplateBody) {
+ HeatTemplate heatTemplate = new HeatTemplate();
+ heatTemplate.setTemplateName(moduleHeatTemplateName);
+ heatTemplate.setTemplateBody(moduleHeatTemplateBody);
+ heatTemplate.setTimeoutMinutes(TIMEOUT_IN_MIN);
+ heatTemplate.setChildTemplates(createChildHeatTemplate(childTemplateName, childTemplateBody));
+ return heatTemplate;
+ }
+
+ private List<HeatTemplate> createChildHeatTemplate(String moduleHeatTemplateName, String moduleHeatTemplateBody) {
+ HeatTemplate heatTemplate = new HeatTemplate();
+ heatTemplate.setTemplateName(moduleHeatTemplateName);
+ heatTemplate.setTemplateBody(moduleHeatTemplateBody);
+ return Lists.newArrayList(heatTemplate);
+ }
+
+ private List<VduArtifact> createExpectedVduArtifacts() {
+ return Lists.newArrayList(
+ new VduArtifact(MODULE_HEAT_TEMPLATE_NAME, MODULE_HEAT_TEMPLATE_BODY.getBytes(),
+ ArtifactType.MAIN_TEMPLATE),
+ new VduArtifact(NESTED_TEMPLATE_NAME, NESTED_TEMPLATE_BODY.getBytes(), ArtifactType.NESTED_TEMPLATE),
+ new VduArtifact(CLOUD_FILE_NAME, CLOUD_FILE_BODY.getBytes(), ArtifactType.TEXT_FILE),
+ new VduArtifact(HEAT_ENV_NAME, HEAT_ENV_CONTENT.getBytes(), ArtifactType.ENVIRONMENT));
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java
index cf68f097dc..d2b6d4f633 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java
@@ -33,7 +33,6 @@ import org.onap.so.db.catalog.beans.AuthenticationType;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.ServerType;
-import org.onap.so.db.catalog.data.repository.CloudIdentityRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
@@ -76,8 +75,6 @@ public class BaseRestTestUtils {
public ObjectMapper mapper;
- @Autowired
- private CloudIdentityRepository cloudIdentityRepository;
protected String readJsonFileAsString(String fileLocation) throws JsonParseException, JsonMappingException, IOException{
ObjectMapper mapper = new ObjectMapper();
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java
index dea6512d38..34bf9cb0f5 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java
@@ -24,12 +24,13 @@ import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest;
import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+
-import javax.ws.rs.PathParam;
import java.util.List;
import java.util.Map;
@@ -38,20 +39,24 @@ public class InfraActiveRequestsRepositoryCustomController {
@Autowired
InfraActiveRequestsRepository infraActiveRequestsRepository;
+
@RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive")
- public List<InfraActiveRequests> getCloudOrchestrationFiltersFromInfraActive(@RequestBody Map<String, String> orchestrationMap){
+ public List<InfraActiveRequests> getCloudOrchestrationFiltersFromInfraActive(@RequestBody Map<String, String> orchestrationMap) {
return infraActiveRequestsRepository.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap);
}
+
@RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive")
- public List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive(@RequestBody Map<String, List<String>> orchestrationMap){
- return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap);
+ public List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive(@RequestBody Map<String, List<String>> orchestrationMap) {
+ return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap);
}
- @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/checkVnfIdStatus/{nsInstanceId}")
- public InfraActiveRequests checkVnfIdStatus(@PathParam("nsInstanceId") String operationalEnvironmentId){
+
+ @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/checkVnfIdStatus/{operationalEnvironmentId}")
+ public InfraActiveRequests checkVnfIdStatus(@PathVariable("operationalEnvironmentId") String operationalEnvironmentId) {
return infraActiveRequestsRepository.checkVnfIdStatus(operationalEnvironmentId);
}
+
@RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/checkInstanceNameDuplicate")
- public InfraActiveRequests checkInstanceNameDuplicate(@RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest){
- return infraActiveRequestsRepository.checkInstanceNameDuplicate(instanceNameDuplicateCheckRequest.getInstanceIdMap(), instanceNameDuplicateCheckRequest.getInstanceName(),instanceNameDuplicateCheckRequest.getRequestScope());
+ public InfraActiveRequests checkInstanceNameDuplicate(@RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest) {
+ return infraActiveRequestsRepository.checkInstanceNameDuplicate(instanceNameDuplicateCheckRequest.getInstanceIdMap(), instanceNameDuplicateCheckRequest.getInstanceName(), instanceNameDuplicateCheckRequest.getRequestScope());
}
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
new file mode 100644
index 0000000000..58eb0085ad
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
@@ -0,0 +1,244 @@
+package org.onap.so.adapters.requestsdb;
+
+
+import org.junit.Before;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest;
+import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.util.UriComponentsBuilder;
+
+import javax.ws.rs.core.MediaType;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.UUID;
+import java.util.ArrayList;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = MSORequestDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+@Transactional
+public class InfraActiveRequestsRepositoryCustomControllerTest {
+
+ @LocalServerPort
+ private int port;
+
+ private String createURLWithPort(String uri) {
+ return "http://localhost:" + port + uri;
+ }
+
+ private InfraActiveRequests infraActiveRequests;
+ private InfraActiveRequests infraActiveRequestsResponse;
+ private HttpHeaders headers;
+ private TestRestTemplate restTemplate;
+
+ private void verifyInfraActiveRequests() {
+ assertEquals(infraActiveRequests.getRequestId(), infraActiveRequestsResponse.getRequestId());
+ assertEquals(infraActiveRequests.getServiceInstanceId(), infraActiveRequestsResponse.getServiceInstanceId());
+ assertEquals(infraActiveRequests.getServiceInstanceName(), infraActiveRequestsResponse.getServiceInstanceName());
+ assertEquals(infraActiveRequests.getVnfId(), infraActiveRequestsResponse.getVnfId());
+ assertEquals(infraActiveRequests.getVnfName(), infraActiveRequestsResponse.getVnfName());
+ assertEquals(infraActiveRequests.getVfModuleId(), infraActiveRequestsResponse.getVfModuleId());
+ assertEquals(infraActiveRequests.getVfModuleName(), infraActiveRequestsResponse.getVfModuleName());
+ assertEquals(infraActiveRequests.getVolumeGroupId(), infraActiveRequestsResponse.getVolumeGroupId());
+ assertEquals(infraActiveRequests.getVolumeGroupName(), infraActiveRequestsResponse.getVolumeGroupName());
+ assertEquals(infraActiveRequests.getNetworkId(), infraActiveRequestsResponse.getNetworkId());
+ assertEquals(infraActiveRequests.getNetworkName(), infraActiveRequestsResponse.getNetworkName());
+ assertEquals(infraActiveRequests.getConfigurationId(), infraActiveRequestsResponse.getConfigurationId());
+ assertEquals(infraActiveRequests.getConfigurationName(), infraActiveRequestsResponse.getConfigurationName());
+ assertEquals(infraActiveRequests.getAaiServiceId(), infraActiveRequestsResponse.getAaiServiceId());
+ assertEquals(infraActiveRequests.getTenantId(), infraActiveRequestsResponse.getTenantId());
+ assertEquals(infraActiveRequests.getRequestScope(), infraActiveRequestsResponse.getRequestScope());
+ assertEquals(infraActiveRequests.getRequestorId(), infraActiveRequestsResponse.getRequestorId());
+ assertEquals(infraActiveRequests.getSource(), infraActiveRequestsResponse.getSource());
+ assertEquals(infraActiveRequests.getOperationalEnvId(), infraActiveRequestsResponse.getOperationalEnvId());
+ assertEquals(infraActiveRequests.getOperationalEnvName(), infraActiveRequestsResponse.getOperationalEnvName());
+ assertEquals(infraActiveRequests.getRequestStatus(), infraActiveRequestsResponse.getRequestStatus());
+ assertEquals(infraActiveRequests.getAction(), infraActiveRequestsResponse.getAction());
+ }
+
+ @Before
+ public void setup() {
+
+ headers = new HttpHeaders();
+ restTemplate = new TestRestTemplate("test", "test");
+
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type", MediaType.APPLICATION_JSON);
+
+ infraActiveRequests = new InfraActiveRequests();
+
+ infraActiveRequests.setRequestId(UUID.randomUUID().toString());
+ infraActiveRequests.setOperationalEnvId(UUID.randomUUID().toString());
+ infraActiveRequests.setServiceInstanceId(UUID.randomUUID().toString());
+ infraActiveRequests.setServiceInstanceName("serviceInstanceNameTest");
+ infraActiveRequests.setVnfId(UUID.randomUUID().toString());
+ infraActiveRequests.setVnfName("vnfInstanceNameTest");
+ infraActiveRequests.setVfModuleId(UUID.randomUUID().toString());
+ infraActiveRequests.setVfModuleName("vfModuleInstanceNameTest");
+ infraActiveRequests.setVolumeGroupId(UUID.randomUUID().toString());
+ infraActiveRequests.setVolumeGroupName("volumeGroupInstanceNameTest");
+ infraActiveRequests.setNetworkId(UUID.randomUUID().toString());
+ infraActiveRequests.setNetworkName("networkInstanceNameTest");
+ infraActiveRequests.setConfigurationId(UUID.randomUUID().toString());
+ infraActiveRequests.setConfigurationName("configurationInstanceNameTest");
+ infraActiveRequests.setAicCloudRegion("1");
+ infraActiveRequests.setTenantId(UUID.randomUUID().toString());
+ infraActiveRequests.setRequestScope("operationalEnvironment");
+ infraActiveRequests.setRequestorId(UUID.randomUUID().toString());
+ infraActiveRequests.setSource("sourceTest");
+ infraActiveRequests.setOperationalEnvName(UUID.randomUUID().toString());
+ infraActiveRequests.setRequestStatus("IN_PROGRESS");
+ infraActiveRequests.setAction("create");
+
+ HttpEntity<String> entity = new HttpEntity(infraActiveRequests, headers);
+
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests"));
+ ResponseEntity<String> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entity, String.class);
+
+ assertEquals(201, response.getStatusCodeValue());
+ }
+
+
+ @Test
+ public void getCloudOrchestrationFiltersFromInfraActiveTest() {
+
+ Map<String, String> requestMap = new HashMap<>();
+ requestMap.put("operationalEnvironmentId", infraActiveRequests.getOperationalEnvId());
+ requestMap.put("operationalEnvironmentName", infraActiveRequests.getOperationalEnvName());
+ requestMap.put("resourceType", "operationalEnvironment");
+
+ HttpEntity<Map<String, String>> entity = new HttpEntity<>(requestMap, headers);
+
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests") + "/getCloudOrchestrationFiltersFromInfraActive");
+
+ ResponseEntity<List<InfraActiveRequests>> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entity, new ParameterizedTypeReference<List<InfraActiveRequests>>() {
+ });
+
+ List<InfraActiveRequests> iarr = response.getBody();
+ assertEquals(200, response.getStatusCodeValue());
+
+ assertTrue(iarr.size() == 1);
+ infraActiveRequestsResponse = iarr.get(0);
+
+ verifyInfraActiveRequests();
+
+ }
+
+ @Test
+ public void getOrchestrationFiltersFromInfraActiveTest() {
+
+ Map<String, List<String>> requestMap = new HashMap<>();
+ List<String> values = new ArrayList<>();
+ values.add("EQUALS");
+ values.add(infraActiveRequests.getServiceInstanceId());
+ requestMap.put("serviceInstanceId", values);
+
+ values = new ArrayList<>();
+ values.add("EQUALS");
+ values.add(infraActiveRequests.getServiceInstanceName());
+ requestMap.put("serviceInstanceName", values);
+
+ HttpEntity<Map<String, List<String>>> entityList = new HttpEntity(requestMap, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests") + "/getOrchestrationFiltersFromInfraActive");
+
+ ResponseEntity<List<InfraActiveRequests>> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entityList, new ParameterizedTypeReference<List<InfraActiveRequests>>() {
+ });
+
+ List<InfraActiveRequests> iarr = response.getBody();
+
+ assertEquals(200, response.getStatusCodeValue());
+
+ assertTrue(iarr.size() == 1);
+ infraActiveRequestsResponse = iarr.get(0);
+
+ verifyInfraActiveRequests();
+ }
+
+ @Test
+ public void checkVnfIdStatusTest() {
+
+ HttpEntity<List<String>> entityList = new HttpEntity("", headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests" + "/checkVnfIdStatus/" + infraActiveRequests.getOperationalEnvId()));
+
+ ResponseEntity<InfraActiveRequests> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.GET, HttpEntity.EMPTY, InfraActiveRequests.class);
+
+ infraActiveRequestsResponse = response.getBody();
+
+ assertEquals(200, response.getStatusCodeValue());
+
+ verifyInfraActiveRequests();
+ }
+
+ @Test
+ public void checkInstanceNameDuplicateTest() {
+
+ InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest = new InstanceNameDuplicateCheckRequest((HashMap<String, String>) null,
+ infraActiveRequests.getOperationalEnvName(),
+ infraActiveRequests.getRequestScope());
+
+ HttpEntity<InstanceNameDuplicateCheckRequest> entityList = new HttpEntity(instanceNameDuplicateCheckRequest, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests") + "/checkInstanceNameDuplicate");
+
+ ResponseEntity<InfraActiveRequests> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entityList, new ParameterizedTypeReference<InfraActiveRequests>() {
+ });
+
+ infraActiveRequestsResponse = response.getBody();
+
+ assertEquals(200, response.getStatusCodeValue());
+
+ verifyInfraActiveRequests();
+ }
+
+ @Test
+ public void checkInstanceNameDuplicateViaTest() {
+
+ Map<String, String> requestMap = new HashMap<>();
+ requestMap.put("operationalEnvironmentId", infraActiveRequests.getOperationalEnvId());
+
+ InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest = new InstanceNameDuplicateCheckRequest((HashMap<String, String>) requestMap,
+ null,
+ infraActiveRequests.getRequestScope());
+
+ HttpEntity<InstanceNameDuplicateCheckRequest> entityList = new HttpEntity(instanceNameDuplicateCheckRequest, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests") + "/checkInstanceNameDuplicate");
+
+ ResponseEntity<InfraActiveRequests> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entityList, new ParameterizedTypeReference<InfraActiveRequests>() {
+ });
+
+ infraActiveRequestsResponse = response.getBody();
+
+ assertEquals(200, response.getStatusCodeValue());
+
+ verifyInfraActiveRequests();
+ }
+} \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml b/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
index c3be9323fb..6a5db78f8b 100644
--- a/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
+++ b/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
@@ -10,7 +10,7 @@ mso:
site-name: localSite
infra-requests:
archived:
- period: 1
+ period: 0
spring:
datasource:
url: jdbc:mariadb://localhost:3307/requestdb
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java b/adapters/mso-vnf-adapter/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java
deleted file mode 100644
index c3d9cca0e9..0000000000
--- a/adapters/mso-vnf-adapter/src/test/java/org/onap/so/adapters/vdu/mapper/VfModuleCustomizationToVduMapperTest.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vdu.mapper;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.so.adapters.vdu.VduArtifact;
-import org.onap.so.adapters.vdu.VduArtifact.ArtifactType;
-import org.onap.so.adapters.vdu.VduModelInfo;
-import org.onap.so.db.catalog.CatalogDatabase;
-import org.onap.so.db.catalog.beans.HeatEnvironment;
-import org.onap.so.db.catalog.beans.HeatFiles;
-import org.onap.so.db.catalog.beans.HeatTemplate;
-import org.onap.so.db.catalog.beans.VfModule;
-import org.onap.so.db.catalog.beans.VfModuleCustomization;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({CatalogDatabase.class})
-public class VfModuleCustomizationToVduMapperTest {
-
- private static final String HEAT_TEMPLATE_ARTIFACT_UUID = "testHeatTemplate";
- private static final String VF_MODULE_MODEL_UUID = "vfModuleUuid";
- private static final String HEAT_ENV_ARTIFACT_UUID = "heatEnvArtifactUuid";
- private static final String MAIN_TEMPLATE_NAME = "testTempName";
- private static final String MAIN_TEMPLATE_BODY = "testTempBody";
- private static final String NESTED_TEMPLATE_KEY = "testKey";
- private static final String NESTED_TEMPLATE_VALUE = "nestedTemplateTest";
- private static final String HEAT_FILE_NAME = "heatFileName";
- private static final String HEAT_FILE_BODY = "heatFileBodyTest";
- private static final String HEAT_ENV_NAME = "heatEnvName";
- private static final String HEAT_ENV = "heatEnv";
- private static final String VOL_HEAT_TEMPLATE_ARTIFACT = "volEnvArtifact";
- private static final String VOL_ENV_ARTIFACT_UUID = "volEnvArtifactUuid";
-
- private VfModuleCustomizationToVduMapper testedObject;
- private CatalogDatabase catalogDatabaseMock;
-
- @Before
- public void init() {
- PowerMockito.mockStatic(CatalogDatabase.class);
- catalogDatabaseMock = mock(CatalogDatabase.class);
- testedObject = new VfModuleCustomizationToVduMapper();
- PowerMockito.when(CatalogDatabase.getInstance()).thenReturn(catalogDatabaseMock);
- when(catalogDatabaseMock.getNestedTemplates(HEAT_TEMPLATE_ARTIFACT_UUID)).thenReturn(createNestedTemplates());
- when(catalogDatabaseMock.getHeatFilesForVfModule(VF_MODULE_MODEL_UUID)).thenReturn(createHeatFileMap());
- }
-
- @Test
- public void mapVfModuleCustomizationToVdu_successful() {
- when(catalogDatabaseMock.getHeatTemplateByArtifactUuid(HEAT_TEMPLATE_ARTIFACT_UUID))
- .thenReturn(createHeatTemplate());
- when(catalogDatabaseMock.getHeatEnvironmentByArtifactUuid(HEAT_ENV_ARTIFACT_UUID))
- .thenReturn(createHeatEnvironment());
- VduModelInfo result = testedObject.mapVfModuleCustomizationToVdu(createVfModuleCustomization());
- assertThat(result.getArtifacts()).containsExactly(createExpectedResultArray());
- }
-
- @Test
- public void mapVfModuleCustVolumeToVdu_successful() {
- when(catalogDatabaseMock.getHeatTemplateByArtifactUuid(VOL_HEAT_TEMPLATE_ARTIFACT))
- .thenReturn(createHeatTemplate());
- when(catalogDatabaseMock.getHeatEnvironmentByArtifactUuid(VOL_ENV_ARTIFACT_UUID))
- .thenReturn(createHeatEnvironment());
- VduModelInfo result = testedObject.mapVfModuleCustVolumeToVdu(createVfModuleCustomization());
- assertThat(result.getArtifacts()).containsExactly(createExpectedResultArray());
- }
-
- private VfModuleCustomization createVfModuleCustomization() {
- VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
- VfModule vfModule = new VfModule();
- vfModule.setHeatTemplateArtifactUUId(HEAT_TEMPLATE_ARTIFACT_UUID);
- vfModule.setVolHeatTemplateArtifactUUId(VOL_HEAT_TEMPLATE_ARTIFACT);
- vfModuleCustomization.setVfModule(vfModule);
- vfModuleCustomization.setVfModuleModelUuid(VF_MODULE_MODEL_UUID);
- vfModuleCustomization.setHeatEnvironmentArtifactUuid(HEAT_ENV_ARTIFACT_UUID);
- vfModuleCustomization.setVolEnvironmentArtifactUuid(VOL_ENV_ARTIFACT_UUID);
- return vfModuleCustomization;
- }
-
- private HeatTemplate createHeatTemplate() {
- HeatTemplate heatTemplate = new HeatTemplate();
- heatTemplate.setTemplateName(MAIN_TEMPLATE_NAME);
- heatTemplate.setTemplateBody(MAIN_TEMPLATE_BODY);
- heatTemplate.setArtifactUuid(HEAT_TEMPLATE_ARTIFACT_UUID);
- return heatTemplate;
- }
-
- private Map<String, Object> createNestedTemplates() {
- Map<String, Object> map = new HashMap<>();
- map.put(NESTED_TEMPLATE_KEY, NESTED_TEMPLATE_VALUE);
- return map;
- }
-
- private Map<String, HeatFiles> createHeatFileMap() {
- HeatFiles heatFiles = new HeatFiles();
- heatFiles.setFileName(HEAT_FILE_NAME);
- heatFiles.setFileBody(HEAT_FILE_BODY);
- Map<String, HeatFiles> map = new HashMap<>();
- map.put("heatFileKey", heatFiles);
- return map;
- }
-
- private HeatEnvironment createHeatEnvironment() {
- HeatEnvironment heatEnvironment = new HeatEnvironment();
- heatEnvironment.setName(HEAT_ENV_NAME);
- heatEnvironment.setEnvironment(HEAT_ENV);
- return heatEnvironment;
- }
-
-
- private VduArtifact[] createExpectedResultArray() {
- VduArtifact[] vduArtifactsArray = new VduArtifact[4];
- vduArtifactsArray[0] = new VduArtifact(MAIN_TEMPLATE_NAME, MAIN_TEMPLATE_BODY.getBytes(),
- ArtifactType.MAIN_TEMPLATE);
- vduArtifactsArray[1] = new VduArtifact(NESTED_TEMPLATE_KEY, NESTED_TEMPLATE_VALUE.getBytes(),
- ArtifactType.NESTED_TEMPLATE);
- vduArtifactsArray[2] = createVduArtifact(HEAT_FILE_NAME, HEAT_FILE_BODY, ArtifactType.TEXT_FILE);
- vduArtifactsArray[3] = createVduArtifact(HEAT_ENV_NAME, HEAT_ENV, ArtifactType.ENVIRONMENT);
- return vduArtifactsArray;
- }
-
- private VduArtifact createVduArtifact(String name, String content, ArtifactType artifactType) {
- VduArtifact vduArtifact = new VduArtifact();
- vduArtifact.setName(name);
- vduArtifact.setContent(content.getBytes());
- vduArtifact.setType(artifactType);
- return vduArtifact;
- }
-
-}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java b/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java
index bbd7cc06e3..2383e7d810 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java
@@ -36,7 +36,7 @@ public class WebSecurityConfigImpl extends WebSecurityConfig {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/manage/health","/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString())
+ .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),","))
.and()
.httpBasic();
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
index 81e2b40bb2..cae80e9137 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
@@ -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.
@@ -28,8 +28,6 @@ import org.onap.so.rest.RESTConfig
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-
class AaiUtil {
private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AaiUtil.class);
@@ -101,6 +99,15 @@ class AaiUtil {
return uri
}
+ public String getAAIServiceInstanceUri(DelegateExecution execution) {
+ String uri = getBusinessCustomerUri(execution)
+
+ uri = uri +"/" + execution.getVariable("globalSubscriberId") + "/service-subscriptions/service-subscription/" + UriUtils.encode(execution.getVariable("serviceType"),"UTF-8") + "/service-instances/service-instance/" + UriUtils.encode(execution.getVariable("serviceInstanceId"),"UTF-8")
+
+ msoLogger.debug('AaiUtil.getAAIRequestInputUri() - AAI URI: ' + uri)
+ return uri
+ }
+
//public String getBusinessCustomerUriv7(DelegateExecution execution) {
// // //def uri = getUri(execution, BUSINESS_CUSTOMERV7)
// def uri = getUri(execution, 'Customer')
@@ -646,4 +653,85 @@ class AaiUtil {
return 0
}
}
+
+ private def getPInterface(DelegateExecution execution, String aai_uri) {
+
+ String namespace = getNamespaceFromUri(aai_uri)
+ String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+ String serviceAaiPath = ${aai_endpoint}${aai_uri}
+
+ APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
+ return new XmlParser().parseText(response.getResponseBodyAsString())
+ }
+
+ // This method checks if interface is remote
+ private def isPInterfaceRemote(DelegateExecution execution, String uri) {
+ if(uri.contains("ext-aai-network")) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ // This method returns Local and remote TPs information from AAI
+ public Map getTPsfromAAI(DelegateExecution execution) {
+ Map tpInfo = [:]
+
+ String aai_uri = '/aai/v14/network/logical-links'
+
+ String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+ String serviceAaiPath = ${aai_endpoint}${aai_uri}
+
+ APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
+
+ def logicalLinks = new XmlParser().parseText(response.getResponseBodyAsString())
+
+ logicalLinks."logical-links".find { link ->
+ def pInterface = []
+ def relationship = link."relationship-list"."relationship"
+ relationship.each {
+ if ("p-interface".compareToIgnoreCase(it."related-to")) {
+ pInterface.add(it)
+ }
+ }
+ if (pInterface.size() == 2) {
+ def localTP = null
+ def remoteTP = null
+
+ if (pInterface[0]."related-link".contains("ext-aai-networks")) {
+ remoteTP = pInterface[0]
+ localTP = pInterface[1]
+ }
+
+ if (pInterface[1]."related-link".contains("ext-aai-networks")) {
+ localTP = pInterface[0]
+ remoteTP = pInterface[1]
+ }
+
+ if (localTP != null && remoteTP != null) {
+
+ // give local tp
+ var intfLocal = getPInterface(execution, localTP."related-link")
+ tpInfotpInfo.put("local-access-node-id", localTP."related-link".split("/")[6])
+
+ def networkRef = intfLocal."network-ref".split("/")
+ tpInfo.put("local-access-provider-id", networkRef[1])
+ tpInfo.put("local-access-client-id", networkRef[3])
+ tpInfo.put("local-access-topology-id", networkRef[5])
+ tpInfo.put("local-access-ltp-id", localTP."interface-name")
+
+ // give local tp
+ var intfRemote = getPInterface(execution, remoteTP."related-link")
+ tpInfo.put("remote-access-node-id", remoteTP."related-link".split("/")[6])
+ def networkRefRemote = intfRemote."network-ref".split("/")
+ tpInfo.put("remote-access-provider-id", networkRefRemote[1])
+ tpInfo.put("remote-access-client-id", networkRefRemote[3])
+ tpInfo.put("remote-access-topology-id", networkRefRemote[5])
+ tpInfo.put("remote-access-ltp-id", remoteTP."interface-name")
+ }
+ }
+
+ }
+ return tpInfo
+ }
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
index f2f41acb6b..2c2cd8269c 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
@@ -22,6 +22,7 @@ package org.onap.so.bpmn.common.scripts
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
+import org.onap.so.logger.MsoLogger
import org.onap.so.rest.APIResponse
import org.onap.so.rest.RESTClient
import org.onap.so.rest.RESTConfig
@@ -36,8 +37,8 @@ class ExternalAPIUtil {
public MsoUtils utils = new MsoUtils()
ExceptionUtil exceptionUtil = new ExceptionUtil()
-
- private AbstractServiceTaskProcessor taskProcessor
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExternalAPIUtil.class)
public static final String PostServiceOrderRequestsTemplate =
"{\n" +
@@ -62,8 +63,8 @@ class ExternalAPIUtil {
"\t\t\"action\": <action>,\n" +
"\t\t\"service\": {\n" +
"\t\t\t\"serviceState\": <serviceState>,\n" +
+ "\t\t\t\"id\": <serviceId>,\n" +
"\t\t\t\"name\": <serviceName>,\n" +
- "\t\t\t\"serviceType\": <serviceType>,\n" +
"\t\t\t\"serviceSpecification\": { \n" +
"\t\t\t\t\"id\": <serviceUuId> \n" +
"\t\t\t},\n" +
@@ -82,16 +83,12 @@ class ExternalAPIUtil {
"\t} \n" +
"}"
- public ExternalAPIUtil(AbstractServiceTaskProcessor taskProcessor) {
- this.taskProcessor = taskProcessor
- }
// public String getUri(DelegateExecution execution, resourceName) {
//
-// def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
// def uri = execution.getVariable("ExternalAPIURi")
// if(uri) {
-// taskProcessor.logDebug("ExternalAPIUtil.getUri: " + uri, isDebugLogEnabled)
+// msoLogger.debug("ExternalAPIUtil.getUri: " + uri)
// return uri
// }
//
@@ -99,21 +96,21 @@ class ExternalAPIUtil {
// }
public String setTemplate(String template, Map<String, String> valueMap) {
- taskProcessor.logDebug("ExternalAPIUtil setTemplate", true);
+ msoLogger.debug("ExternalAPIUtil setTemplate", true);
StringBuffer result = new StringBuffer();
String pattern = "<.*>";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(template);
- taskProcessor.logDebug("ExternalAPIUtil template:" + template, true);
+ msoLogger.debug("ExternalAPIUtil template:" + template, true);
while (m.find()) {
String key = template.substring(m.start() + 1, m.end() - 1);
- taskProcessor.logDebug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true);
+ msoLogger.debug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true);
m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""));
}
m.appendTail(result);
- taskProcessor.logDebug("ExternalAPIUtil return:" + result.toString(), true);
+ msoLogger.debug("ExternalAPIUtil return:" + result.toString(), true);
return result.toString();
}
@@ -129,13 +126,12 @@ class ExternalAPIUtil {
*
*/
public APIResponse executeExternalAPIGetCall(DelegateExecution execution, String url){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug(" ======== STARTED Execute ExternalAPI Get Process ======== ", isDebugEnabled)
+ msoLogger.debug(" ======== STARTED Execute ExternalAPI Get Process ======== ")
APIResponse apiResponse = null
try{
String uuid = utils.getRequestID()
- taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled)
- taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled)
+ msoLogger.debug( "Generated uuid is: " + uuid)
+ msoLogger.debug( "URL to be used is: " + url)
String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_externalapi_auth"),execution.getVariable("URN_mso_msoKey"))
@@ -147,9 +143,9 @@ class ExternalAPIUtil {
}
apiResponse = client.get()
- taskProcessor.logDebug( "======== COMPLETED Execute ExternalAPI Get Process ======== ", isDebugEnabled)
+ msoLogger.debug( "======== COMPLETED Execute ExternalAPI Get Process ======== ")
}catch(Exception e){
- taskProcessor.logDebug("Exception occured while executing ExternalAPI Get Call. Exception is: \n" + e, isDebugEnabled)
+ msoLogger.debug("Exception occured while executing ExternalAPI Get Call. Exception is: \n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e.getMessage())
}
return apiResponse
@@ -168,13 +164,12 @@ class ExternalAPIUtil {
*
*/
public APIResponse executeExternalAPIPostCall(DelegateExecution execution, String url, String payload){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug( " ======== Started Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( " ======== Started Execute ExternalAPI Post Process ======== ")
APIResponse apiResponse = null
try{
String uuid = utils.getRequestID()
- taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled)
- taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled)
+ msoLogger.debug( "Generated uuid is: " + uuid)
+ msoLogger.debug( "URL to be used is: " + url)
String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_externalapi_auth"),execution.getVariable("URN_mso_msoKey"))
RESTConfig config = new RESTConfig(url);
@@ -185,9 +180,9 @@ class ExternalAPIUtil {
}
apiResponse = client.httpPost(payload)
- taskProcessor.logDebug( "======== Completed Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( "======== Completed Execute ExternalAPI Post Process ======== ")
}catch(Exception e){
- taskProcessor.utils.log("ERROR", "Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e, isDebugEnabled)
+ msoLogger.error("Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e.getMessage())
}
return apiResponse
@@ -209,11 +204,10 @@ class ExternalAPIUtil {
*
*/
public APIResponse executeExternalAPIPostCall(DelegateExecution execution, String url, String payload, String authenticationHeaderValue, String headerName, String headerValue){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug( " ======== Started Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( " ======== Started Execute ExternalAPI Post Process ======== ")
APIResponse apiResponse = null
try{
- taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled)
+ msoLogger.debug( "URL to be used is: " + url)
String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_externalapi_auth"),execution.getVariable("URN_mso_msoKey"))
@@ -224,9 +218,9 @@ class ExternalAPIUtil {
}
apiResponse = client.httpPost(payload)
- taskProcessor.logDebug( "======== Completed Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( "======== Completed Execute ExternalAPI Post Process ======== ")
}catch(Exception e){
- taskProcessor.utils.log("ERROR", "Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e, isDebugEnabled)
+ msoLogger.error("Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e.getMessage())
}
return apiResponse
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceInstance.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceInstance.java
index 6d2db0ca33..4295f50a3c 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceInstance.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceInstance.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.
@@ -46,6 +46,8 @@ public class ServiceInstance extends JsonWrapper implements Serializable {
private String environmentContext;
private String workloadContext;
private Map serviceParams;
+ private Customer customer = new Customer();
+ private String e2eVpnKey;
public String getServiceType() {
return serviceType;
@@ -113,4 +115,15 @@ public class ServiceInstance extends JsonWrapper implements Serializable {
public void setServiceRole(String serviceRole) {
this.serviceRole = serviceRole;
}
-} \ No newline at end of file
+ public Customer getCustomer(){
+ return customer;
+ }
+
+ public String getE2eVpnKey(){
+ return e2eVpnKey;
+ }
+
+ public void setE2eVpnKey(String e2eVpnKey){
+ this.e2eVpnKey = e2eVpnKey;
+ }
+}
diff --git a/bpmn/mso-infrastructure-bpmn/pom.xml b/bpmn/mso-infrastructure-bpmn/pom.xml
index e44156daa9..151ba2c3aa 100644
--- a/bpmn/mso-infrastructure-bpmn/pom.xml
+++ b/bpmn/mso-infrastructure-bpmn/pom.xml
@@ -196,5 +196,10 @@
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.0.5</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>so-bpmn-tasks</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java
index d42717f5c1..b514c38d47 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java
@@ -30,18 +30,17 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.history.HistoricVariableInstance;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.test.Deployment;
import org.camunda.bpm.engine.test.ProcessEngineRule;
import org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.so.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.DmaapClientTestImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
@@ -61,6 +60,9 @@ public class CreateAndActivatePnfResourceTest {
@Autowired
private AaiConnectionTestImpl aaiConnection;
+ @Autowired
+ private DmaapClientTestImpl dmaapClientTestImpl;
+
@Test
@Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"})
public void shouldSaveCurrentIpToVariableIfItAlreadyExistsInAai() throws Exception {
@@ -96,9 +98,8 @@ public class CreateAndActivatePnfResourceTest {
ProcessInstance instance = runtimeService
.startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables);
assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage");
- runtimeService.createMessageCorrelation("WorkflowMessage")
- .processInstanceBusinessKey("businessKey")
- .correlateWithResult();
+ dmaapClientTestImpl.sendMessage();
+
// then
assertThat(instance).isEnded().hasPassedInOrder(
"CreateAndActivatePnf_StartEvent",
@@ -125,9 +126,8 @@ public class CreateAndActivatePnfResourceTest {
ProcessInstance instance = runtimeService
.startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables);
assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage");
- runtimeService.createMessageCorrelation("WorkflowMessage")
- .processInstanceBusinessKey("businessKey")
- .correlateWithResult();
+ dmaapClientTestImpl.sendMessage();
+
// then
assertThat(instance).isEnded().hasPassedInOrder(
"CreateAndActivatePnf_StartEvent",
diff --git a/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
index 0b998c7268..d7bb084195 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
+++ b/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
@@ -183,12 +183,14 @@ policy:
sniro:
conductor:
enabled: true
- host: http://localhost:8446
+ host: http://localhost:${wiremock.server.port}
uri: /v1/release-orders
headers.auth: Basic dGVzdDp0ZXN0cHdk
manager:
- host: http://localhost:8446
- uri: /sniro/api/placement/v2
+ timeout: PT30M
+ host: http://localhost:${wiremock.server.port}
+ uri.v1: /sniro/api/v2/placement
+ uri.v2: /sniro/api/placement/v2
headers.auth: Basic dGVzdDp0ZXN0cHdk
headers.patchVersion: 1
headers.minorVersion: 1
@@ -217,4 +219,4 @@ camunda:
bpm:
metrics:
enabled: false
- db-reporter-activate: false \ No newline at end of file
+ db-reporter-activate: false
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
index 80e6e758c0..f11022dc08 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
@@ -87,10 +87,6 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
boolean is3rdONAPExist = false
- if(inputParameters.has("id"))
- {
- String sppartnerId = inputParameters.get("id")
- }
if(inputParameters.has("url"))
{
String sppartnerUrl = inputParameters.get("url")
@@ -164,7 +160,8 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
//uuiRequest
String incomingRequest = resourceInputObj.getRequestsInputs()
String serviceParameters = jsonUtil.getJsonValue(incomingRequest, "service.parameters")
- JSONObject inputParameters = new JSONObject(customizeResourceParam(serviceParameters))
+ String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs")
+ JSONObject inputParameters = new JSONObject(customizeResourceParam(requestInputs))
execution.setVariable(Prefix + "ServiceParameters", inputParameters)
// CallSource is added only when ONAP SO calling 3rdONAP(External API) SO(Remote call)
@@ -174,6 +171,8 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
{
callSource = inputParameters.get("CallSource")
if("ExternalAPI".equalsIgnoreCase(callSource)) {
+ String sppartnerId = inputParameters.get("SppartnerServiceId")
+ execution.setVariable(Prefix + "SppartnerServiceId", sppartnerId)
isLocalCall = false
}
}
@@ -234,7 +233,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
msoLogger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
- execution.setVariable("serviceInstanceId", serviceInstanceId)
+ execution.setVariable(Prefix + "ServiceInstanceId", serviceInstanceId)
msoLogger.info("serviceInstanceId:" + serviceInstanceId)
} catch (BpmnError e) {
@@ -287,21 +286,32 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
//get TP links from AAI for SOTN handoverMode only
String handoverMode = execution.getVariable(Prefix + "HandoverMode")
if("SOTN".equalsIgnoreCase(handoverMode)) {
- //to do get tp link in AAI
-
-
// Put TP Link info into serviceParameters
- String accessProviderId = ""
- String accessClientId = ""
- String accessTopologyId = ""
- String accessNodeId = ""
- String accessLtpId = ""
- JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
- inputParameters.put("access-provider-id", accessProviderId)
- inputParameters.put("access-client-id", accessClientId)
- inputParameters.put("access-topology-id", accessTopologyId)
- inputParameters.put("access-node-id", accessNodeId)
- inputParameters.put("access-ltp-id", accessLtpId)
+ JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
+
+ Map<String, Object> crossTPs = new HashMap<String, Object>();
+ crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"));
+ crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"));
+ crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"));
+ crossTPs.put("local-access-node-id", inputParameters.get("remote-access-node-id"));
+ crossTPs.put("local-access-ltp-id", inputParameters.get("remote-access-ltp-id"));
+ crossTPs.put("remote-access-provider-id", inputParameters.get("local-access-provider-id"));
+ crossTPs.put("remote-access-client-id", inputParameters.get("local-client-id"));
+ crossTPs.put("remote-access-topology-id", inputParameters.get("local-topology-id"));
+ crossTPs.put("remote-access-node-id", inputParameters.get("local-node-id"));
+ crossTPs.put("remote-access-ltp-id", inputParameters.get("local-ltp-id"));
+
+ inputParameters.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
+ inputParameters.put("local-access-client-id", crossTPs.get("local-access-client-id"));
+ inputParameters.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
+ inputParameters.put("local-access-node-id", crossTPs.get("local-access-node-id"));
+ inputParameters.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
+ inputParameters.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
+ inputParameters.put("remote-access-client-id", crossTPs.get("remote-client-id"));
+ inputParameters.put("remote-access-topology-id", crossTPs.get("remote-topology-id"));
+ inputParameters.put("remote-access-node-id", crossTPs.get("remote-node-id"));
+ inputParameters.put("remote-access-ltp-id", crossTPs.get("remote-ltp-id"));
+
execution.setVariable(Prefix + "ServiceParameters", inputParameters)
}
@@ -331,8 +341,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String action = "add" //for create
String serviceState = "active"
String serviceName = execution.getVariable("serviceInstanceName")
- String serviceType = execution.getVariable("serviceType")
- String serviceId = execution.getVariable("serviceInstanceId")
+ String serviceUuId = execution.setVariable(Prefix + "SppartnerUUID")
Map<String, String> valueMap = new HashMap<>()
valueMap.put("externalId", '"' + externalId + '"')
@@ -348,24 +357,36 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
valueMap.put("orderItemId", '"' + orderItemId + '"')
valueMap.put("action", '"' + action + '"')
valueMap.put("serviceState", '"' + serviceState + '"')
+ valueMap.put("serviceId", '""')//To be confirmed
valueMap.put("serviceName", '"' + serviceName + '"')
- valueMap.put("serviceType", '"' + serviceType + '"')
- valueMap.put("serviceId", '"' + serviceId + '"')
+ valueMap.put("serviceUuId", '"' + serviceUuId + '"')
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
// insert CallSource='ExternalAPI' to uuiRequest
- Map<String, String> callSourceMap = new HashMap<>()
- callSourceMap.put("inputName", "CallSource")
- callSourceMap.put("inputValue", "ExternalAPI")
- String _requestInputs_ = externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, callSourceMap)
+ Map<String, String> requestInputsMap = new HashMap<>()
+ requestInputsMap.put("inputName", "CallSource")
+ requestInputsMap.put("inputValue", "ExternalAPI")
+ String _requestInputs_ = externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
+
+ requestInputsMap.clear()
+ String serviceInstanceId = execution.getVariable(Prefix + "ServiceInstanceId")
+ requestInputsMap.put("inputName", "SppartnerServiceId")
+ requestInputsMap.put("inputValue", serviceInstanceId)
+ _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
+
+ requestInputsMap.clear()
+ String serviceType = execution.getVariable("serviceType")
+ requestInputsMap.put("inputName", "serviceType")
+ requestInputsMap.put("inputValue", serviceType)
+ _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
// Transfer all uuiRequest incomeParameters to ExternalAPI format
JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
for(String key : inputParameters.keySet()) {
String inputName = key
String inputValue = inputParameters.opt(key)
- Map<String, String> requestInputsMap = new HashMap<>()
+ requestInputsMap.clear()
requestInputsMap.put("inputName", '"' + inputName+ '"')
requestInputsMap.put("inputValue", '"' + inputValue + '"')
_requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
@@ -436,7 +457,11 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
msoLogger.debug("Get ServiceOrder Received a Good Response")
- String serviceOrderState = responseObj.get("State")
+
+ String sppartnerServiceId = responseObj.get("orderIterm.service.id")
+ execution.setVariable(Prefix + "SppartnerServiceId", sppartnerServiceId)
+
+ String serviceOrderState = responseObj.get("orderIterm.state")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("serviceOrderState", serviceOrderState)
@@ -491,10 +516,10 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
msoLogger.info(" ***** Started postCreateE2ESIin3rdONAP *****")
- String sppartnerId = UUID.randomUUID().toString()
+ String sppartnerId = execution.getVariable(Prefix + "SppartnerServiceId")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String callSource = execution.getVariable(Prefix + "CallSource")
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String serviceInstanceId = execution.getVariable(Prefix + "ServiceInstanceId")
String globalSubscriberId = execution.getVariable("globalSubscriberId")
String serviceType = execution.getVariable("serviceType")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
new file mode 100644
index 0000000000..15b63fb5ab
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
@@ -0,0 +1,194 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.scripts
+
+import org.json.JSONObject
+import org.json.XML;
+
+import static org.apache.commons.lang3.StringUtils.*;
+import groovy.xml.XmlUtil
+import groovy.json.*
+import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.onap.so.bpmn.common.recipe.ResourceInput;
+import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
+import org.onap.so.bpmn.core.WorkflowException
+import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
+import org.onap.so.logger.MsoLogger
+import org.onap.so.rest.APIResponse
+import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
+
+import java.util.UUID;
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.apache.commons.lang3.*
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.web.util.UriUtils
+import org.onap.so.rest.RESTClient
+import org.onap.so.rest.RESTConfig
+import org.onap.so.rest.APIResponse;
+import org.onap.so.bpmn.common.scripts.AaiUtil
+
+/**
+ * This groovy class supports the <class>CreateDeviceResource.bpmn</class> process.
+ * flow for Device Resource Create
+ */
+public class CreateDeviceResource extends AbstractServiceTaskProcessor {
+
+ String Prefix="CREDEVRES_"
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ JsonUtils jsonUtil = new JsonUtils()
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateDeviceResource.class)
+
+ public void preProcessRequest(DelegateExecution execution){
+ msoLogger.info(" ***** Started preProcessRequest *****")
+ try {
+
+ //get bpmn inputs from resource request.
+ String requestId = execution.getVariable("mso-request-id")
+ String requestAction = execution.getVariable("requestAction")
+ msoLogger.info("The requestAction is: " + requestAction)
+ String recipeParamsFromRequest = execution.getVariable("recipeParams")
+ msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ String resourceInput = execution.getVariable("resourceInput")
+ msoLogger.info("The resourceInput is: " + resourceInput)
+ //Get ResourceInput Object
+ ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
+ execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+ String resourceInputPrameters = resourceInputObj.getResourceParameters()
+ String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
+ JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
+ execution.setVariable(Prefix + "resourceRequestInputs", inputParameters)
+
+ //Deal with recipeParams
+ String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
+ String resourceName = resourceInputObj.getResourceInstanceName()
+ //For sdnc requestAction default is "createNetworkInstance"
+ String operationType = "Network"
+ if(!StringUtils.isBlank(recipeParamsFromRequest)){
+ //the operationType from worflow(first node) is second priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType")
+ }
+ if(!StringUtils.isBlank(recipeParamsFromWf)){
+ //the operationType from worflow(first node) is highest priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
+ }
+
+ execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
+ execution.setVariable("mso-request-id", requestId)
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex){
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ String customizeResourceParam(String networkInputParametersJson) {
+ List<Map<String, Object>> paramList = new ArrayList();
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson);
+ Iterator iterator = jsonObject.keys();
+ while (iterator.hasNext()) {
+ String key = iterator.next();
+ HashMap<String, String> hashMap = new HashMap();
+ hashMap.put("name", key);
+ hashMap.put("value", jsonObject.get(key))
+ paramList.add(hashMap)
+ }
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap();
+ paramMap.put("param", paramList);
+
+ return new JSONObject(paramMap).toString();
+ }
+
+ public void checkDevType(DelegateExecution execution){
+ msoLogger.info(" ***** Started checkDevType *****")
+ try {
+
+ JSONObject inputParameters = execution.getVariable(Prefix + "resourceRequestInputs")
+
+ String devType = inputParameters.get("device_class")
+
+ if(StringUtils.isBlank(devType)) {
+ devType = "OTHER"
+ }
+
+ execution.setVariable("device_class", devType)
+
+ } catch (Exception ex){
+ String msg = "Exception in checkDevType " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void getVNFTemplatefromSDC(DelegateExecution execution){
+ msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void postVNFInfoProcess(DelegateExecution execution){
+ msoLogger.info(" ***** Started postVNFInfoProcess *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ msoLogger.debug(" *** sendSyncResponse *** ")
+
+ try {
+ String operationStatus = "finished"
+ // RESTResponse for main flow
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****")
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
index 88441271b1..63fd20eb2d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
@@ -40,6 +40,7 @@ import org.onap.so.rest.APIResponse
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
import java.util.UUID
+import org.onap.so.logger.MsoLogger
import org.camunda.bpm.engine.runtime.Execution
import org.camunda.bpm.engine.delegate.BpmnError
@@ -52,7 +53,7 @@ import org.onap.so.rest.RESTConfig
/**
* This groovy class supports the <class>Delete3rdONAPE2EServiceInstance.bpmn</class> process.
- * flow for Delete E2EServiceInstance in 3rdONAP
+ * flow for Delete 3rdONAPE2EServiceInstance in 3rdONAP
*/
public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcessor {
@@ -62,27 +63,25 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, Delete3rdONAPE2EServiceInstance.class)
+
public void checkSPPartnerInfoFromAAI (DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started checkSPPartnerInfo *****", isDebugEnabled)
+ msoLogger.info(" ***** Started checkSPPartnerInfo *****")
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- utils.log("INFO","The requestAction is: " + requestAction, isDebugEnabled)
+ msoLogger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- utils.log("INFO","The recipeParams is: " + recipeParamsFromRequest, isDebugEnabled)
+ msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- utils.log("INFO","The resourceInput is: " + resourceInput, isDebugEnabled)
+ msoLogger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
// set local resourceInput
execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
String resourceInstanceId = resourceInputObj.getResourceInstancenUuid()
- String sppartnerId = resourceInstanceId
- execution.setVariable(Prefix + "SppartnerId", sppartnerId)
- utils.log("INFO", "sppartnerId:" + sppartnerId, isDebugEnabled)
// Get Sppartner from AAI
AaiUtil aaiUriUtil = new AaiUtil(this)
@@ -96,12 +95,8 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String callSource = "UUI"
String sppartnerUrl = ""
- String sppartnerVersion = ""
if(execution.getVariable(Prefix + "SuccessIndicator")) {
callSource = execution.getVariable(Prefix + "CallSource")
- sppartnerId = execution.getVariable(Prefix + "SppartnerId")
- sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
- sppartnerVersion = execution.getVariable(Prefix + "SppartnerVersion")
}
boolean is3rdONAPExist = false
@@ -118,14 +113,13 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
throw e
} catch (Exception ex){
String msg = "Exception in checkSPPartnerInfoFromAAI " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void checkLocallCall (DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started checkLocallCall *****", isDebugEnabled)
+ msoLogger.info(" ***** Started checkLocallCall *****")
boolean isLocalCall = true
String callSource = execution.getVariable(Prefix + "CallSource")
@@ -136,8 +130,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
public void preProcessRequest(DelegateExecution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started preProcessRequest *****", isDebugEnabled)
+ msoLogger.info(" ***** Started preProcessRequest *****")
try {
ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")
String msg = ""
@@ -145,61 +138,60 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String globalSubscriberId = resourceInputObj.getGlobalSubscriberId()
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
//set local variable
execution.setVariable("globalSubscriberId", globalSubscriberId)
- utils.log("INFO", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+ msoLogger.info( "globalSubscriberId:" + globalSubscriberId)
String serviceType = resourceInputObj.getServiceType()
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("serviceType", serviceType)
- utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
+ msoLogger.info( "serviceType:" + serviceType)
String operationId = resourceInputObj.getOperationId()
if (isBlank(operationId)) {
msg = "Input operationId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("operationId", operationId)
- utils.log("INFO", "operationId:" + operationId, isDebugEnabled)
+ msoLogger.info( "operationId:" + operationId)
String resourceName = resourceInputObj.getResourceInstanceName()
if (isBlank(resourceName)) {
msg = "Input resourceName is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("resourceName", resourceName)
- utils.log("INFO", "resourceInstanceId:" + resourceName, isDebugEnabled)
+ msoLogger.info( "resourceInstanceId:" + resourceName)
String resourceTemplateId = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
if (isBlank(resourceTemplateId)) {
msg = "Input resourceTemplateId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("resourceTemplateId", resourceTemplateId)
- utils.log("INFO", "resourceTemplateId:" + resourceTemplateId, isDebugEnabled)
+ msoLogger.info( "resourceTemplateId:" + resourceTemplateId)
} catch (BpmnError e) {
throw e
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareUpdateProgress(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started prepareUpdateProgress *****", isDebugEnabled)
+ msoLogger.info(" ***** Started prepareUpdateProgress *****")
ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
@@ -228,12 +220,11 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
</soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
- utils.log("INFO"," ***** End prepareUpdateProgress *****", isDebugEnabled)
+ msoLogger.info(" ***** End prepareUpdateProgress *****")
}
public void prepare3rdONAPRequest(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started prepare3rdONAPRequest *****", isDebugEnabled)
+ msoLogger.info(" ***** Started prepare3rdONAPRequest *****")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String extAPIPath = sppartnerUrl + 'serviceOrder'
@@ -255,7 +246,10 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String serviceState = "active"
String serviceName = ""
String serviceType = execution.getVariable("serviceType")
- String serviceId = execution.getVariable(Prefix + "ServiceInstanceId")
+ String serviceId = execution.getVariable(Prefix + "SppartnerId")
+
+ queryServicefrom3rdONAP(execution)
+ String serviceUuId = execution.getVariable(Prefix + "serviceSpecificationId")
Map<String, String> valueMap = new HashMap<>()
valueMap.put("externalId", '"' + externalId + '"')
@@ -271,9 +265,10 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
valueMap.put("orderItemId", '"' + orderItemId + '"')
valueMap.put("action", '"' + action + '"')
valueMap.put("serviceState", '"' + serviceState + '"')
+ valueMap.put("serviceId", '"' + serviceId + '"')
valueMap.put("serviceName", '"' + serviceName + '"')
valueMap.put("serviceType", '"' + serviceType + '"')
- valueMap.put("serviceId", '"' + serviceId + '"')
+ valueMap.put("serviceUuId", '"' + serviceUuId + '"')
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
@@ -281,12 +276,46 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
execution.setVariable(Prefix + "Payload", payload)
- utils.log("INFO", "Exit " + prepare3rdONAPRequest, isDebugEnabled)
+ msoLogger.info( "Exit " + prepare3rdONAPRequest)
+ }
+
+ private void queryServicefrom3rdONAP(DelegateExecution execution)
+ {
+ msoLogger.info(" ***** Started queryServicefrom3rdONAP *****")
+
+ //https://{api_url}/nbi/api/v1/service/{serviceinstanceid}
+ String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
+ String extAPIPath = sppartnerUrl + "service/" + execution.setVariable(Prefix + "SppartnerId")
+
+ ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+
+ APIResponse response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath)
+
+ int responseCode = response.getStatusCode()
+ execution.setVariable(Prefix + "getServiceResponseCode", responseCode)
+ utils.log("DEBUG", "Get Service response code is: " + responseCode)
+
+ String extApiResponse = response.getResponseBodyAsString()
+ JSONObject responseObj = new JSONObject(extApiResponse)
+ execution.setVariable(Prefix + "getServiceResponse", extApiResponse)
+
+ //Process Response //200 OK 201 CREATED 202 ACCEPTED
+ if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
+ {
+ utils.log("DEBUG", "Get Service Received a Good Response")
+ String serviceUuid = responseObj.get("serviceSpecification.id")
+ execution.setVariable(Prefix + "serviceSpecificationId", serviceUuid)
+ }
+ else{
+ utils.log("DEBUG", "Get Service Received a Bad Response Code. Response Code is: " + responseCode)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Service Received a bad response from 3rdONAP External API")
+ }
+
+ msoLogger.info( "Exit " + queryServicefrom3rdONAP)
}
public void doDeleteE2ESIin3rdONAP(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started doDeleteE2ESIin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started doDeleteE2ESIin3rdONAP *****")
String extAPIPath = execution.getVariable("ExternalAPIURL")
String payload = execution.getVariable(Prefix + "Payload")
@@ -297,7 +326,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "postServiceOrderResponseCode", responseCode)
- utils.log("DEBUG", "Post ServiceOrder response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Post ServiceOrder response code is: " + responseCode)
String extApiResponse = response.getResponseBodyAsString()
JSONObject responseObj = new JSONObject(extApiResponse)
@@ -306,23 +335,22 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- utils.log("DEBUG", "Post ServiceOrder Received a Good Response", isDebugEnabled)
+ msoLogger.debug("Post ServiceOrder Received a Good Response")
String serviceOrderId = responseObj.get("ServiceOrderId")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("serviceOrderId", serviceOrderId)
}
else{
- utils.log("DEBUG", "Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
}
- utils.log("INFO", "Exit " + doDeleteE2ESIin3rdONAP, isDebugEnabled)
+ msoLogger.info( "Exit " + doDeleteE2ESIin3rdONAP)
}
public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started getE2ESIProgressin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
String extAPIPath = execution.getVariable("ExternalAPIURL")
extAPIPath += "/" + execution.getVariable("ServiceOrderId")
@@ -333,7 +361,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "getServiceOrderResponseCode", responseCode)
- utils.log("DEBUG", "Get ServiceOrder response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Get ServiceOrder response code is: " + responseCode)
String extApiResponse = response.getResponseBodyAsString()
JSONObject responseObj = new JSONObject(extApiResponse)
@@ -342,7 +370,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
//Process Response //200 OK 201 CREATED 202 ACCEPTED
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
- utils.log("DEBUG", "Get ServiceOrder Received a Good Response", isDebugEnabled)
+ msoLogger.debug("Get ServiceOrder Received a Good Response")
String serviceOrderState = responseObj.get("State")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("serviceOrderState", serviceOrderState)
@@ -372,38 +400,36 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
}
else{
- utils.log("DEBUG", "Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get ServiceOrder Received a bad response")
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get ServiceOrder Received a bad response from 3rdONAP External API")
}
- utils.log("INFO", "Exit " + getE2ESIProgressin3rdONAP, isDebugEnabled)
+ msoLogger.info( "Exit " + getE2ESIProgressin3rdONAP)
}
/**
* delay 5 sec
*/
public void timeDelay(DelegateExecution execution) {
- def isDebugEnabled= execution.getVariable("isDebugLogEnabled")
try {
Thread.sleep(5000)
} catch(InterruptedException e) {
- utils.log("ERROR", "Time Delay exception" + e , isDebugEnabled)
+ utils.log("ERROR", "Time Delay exception" + e )
}
}
private void getSPPartnerInAAI(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started postDeleteE2ESIin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started postDeleteE2ESIin3rdONAP *****")
AaiUtil aaiUriUtil = new AaiUtil(this)
String serviceAaiPath = execution.getVariable(Prefix + "serviceAaiPath")
APIResponse response = aaiUriUtil.executeAAIGetCall(execution, serviceAaiPath)
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "GetSppartnerResponseCode", responseCode)
- utils.log("DEBUG", " Get sppartner response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug(" Get sppartner response code is: " + responseCode)
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
@@ -414,36 +440,35 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- utils.log("DEBUG", "GET sppartner Received a Good Response", isDebugEnabled)
+ msoLogger.debug("GET sppartner Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable(Prefix + "FoundIndicator", true)
String sppartnerId = utils.getNodeText1(aaiResponse, "sppartner-id")
execution.setVariable(Prefix + "SppartnerId", sppartnerId)
- utils.log("DEBUG", " SppartnerId is: " + sppartnerId, isDebugEnabled)
+ msoLogger.debug(" SppartnerId is: " + sppartnerId)
String sppartnerUrl = utils.getNodeText1(aaiResponse, "sppartner-url")
execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
- utils.log("DEBUG", " SppartnerUrl is: " + sppartnerUrl, isDebugEnabled)
+ msoLogger.debug(" SppartnerUrl is: " + sppartnerUrl)
String callSource = utils.getNodeText1(aaiResponse, "sppartner-callsource")
execution.setVariable(Prefix + "CallSource", callSource)
- utils.log("DEBUG", " CallSource is: " + callSource, isDebugEnabled)
+ msoLogger.debug(" CallSource is: " + callSource)
String sppartnerVersion = utils.getNodeText1(aaiResponse, "resource-version")
execution.setVariable(Prefix + "SppartnerVersion", sppartnerVersion)
- utils.log("DEBUG", " Resource Version is: " + sppartnerVersion, isDebugEnabled)
+ msoLogger.debug(" Resource Version is: " + sppartnerVersion)
}
else
{
- utils.log("DEBUG", "Get sppartner Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Get sppartner Received a Bad Response Code. Response Code is: " + responseCode)
exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
throw new BpmnError("MSOWorkflowException")
}
- utils.log("INFO", "Exit " + deleteSPPartnerInAAI, isDebugEnabled)
+ msoLogger.info( "Exit " + deleteSPPartnerInAAI)
}
public void deleteSPPartnerInAAI(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started postDeleteE2ESIin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started postDeleteE2ESIin3rdONAP *****")
String sppartnerId = execution.getVariable(Prefix + "SppartnerId")
String sppartnerUrl = execution.getVariable(Prefix + "sppartnerUrl")
@@ -454,7 +479,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
APIResponse response = aaiUriUtil.executeAAIDeleteCall(execution, serviceAaiPath)
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "DeleteSppartnerResponseCode", responseCode)
- utils.log("DEBUG", " Get sppartner response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug(" Get sppartner response code is: " + responseCode)
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
@@ -464,21 +489,21 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- utils.log("DEBUG", "Delete sppartner Received a Good Response", isDebugEnabled)
+ msoLogger.debug("Delete sppartner Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
}
else if(responseCode == 404){
- utils.log("DEBUG", " Delete sppartner Received a Not Found (404) Response", isDebugEnabled)
+ msoLogger.debug(" Delete sppartner Received a Not Found (404) Response")
execution.setVariable(Prefix + "FoundIndicator", false)
}
else
{
- utils.log("DEBUG", "Delete sppartner Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Delete sppartner Received a Bad Response Code. Response Code is: " + responseCode)
exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
throw new BpmnError("MSOWorkflowException")
}
- utils.log("INFO", "Exit " + deleteSPPartnerInAAI, isDebugEnabled)
+ msoLogger.info( "Exit " + deleteSPPartnerInAAI)
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
@@ -488,32 +513,30 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
public void postProcess(DelegateExecution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started postProcess *****", isDebugEnabled)
+ msoLogger.info(" ***** Started postProcess *****")
String responseCode = execution.getVariable(Prefix + "putSppartnerResponseCode")
String responseObj = execution.getVariable(Prefix + "putSppartnerResponse")
- utils.log("INFO","response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled)
- utils.log("INFO"," ***** Exit postProcess *****", isDebugEnabled)
+ msoLogger.info("response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj)
+ msoLogger.info(" ***** Exit postProcess *****")
}
public void sendSyncResponse (DelegateExecution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+ msoLogger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled)
+ msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ msoLogger.debug(" ***** Exit sendSyncResopnse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
new file mode 100644
index 0000000000..5a21fd7396
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
@@ -0,0 +1,194 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.scripts
+
+import org.json.JSONObject
+import org.json.XML;
+
+import static org.apache.commons.lang3.StringUtils.*;
+import groovy.xml.XmlUtil
+import groovy.json.*
+import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.onap.so.bpmn.common.recipe.ResourceInput;
+import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
+import org.onap.so.bpmn.core.WorkflowException
+import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
+import org.onap.so.logger.MsoLogger
+import org.onap.so.rest.APIResponse
+import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
+
+import java.util.UUID;
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.apache.commons.lang3.*
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.web.util.UriUtils
+import org.onap.so.rest.RESTClient
+import org.onap.so.rest.RESTConfig
+import org.onap.so.rest.APIResponse;
+import org.onap.so.bpmn.common.scripts.AaiUtil
+
+/**
+ * This groovy class supports the <class>CreateDeviceResource.bpmn</class> process.
+ * flow for Device Resource Create
+ */
+public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
+
+ String Prefix="DELDEVRES_"
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ JsonUtils jsonUtil = new JsonUtils()
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteDeviceResource.class)
+
+ public void preProcessRequest(DelegateExecution execution){
+ msoLogger.info(" ***** Started preProcessRequest *****")
+ try {
+
+ //get bpmn inputs from resource request.
+ String requestId = execution.getVariable("mso-request-id")
+ String requestAction = execution.getVariable("requestAction")
+ msoLogger.info("The requestAction is: " + requestAction)
+ String recipeParamsFromRequest = execution.getVariable("recipeParams")
+ msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ String resourceInput = execution.getVariable("resourceInput")
+ msoLogger.info("The resourceInput is: " + resourceInput)
+ //Get ResourceInput Object
+ ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
+ execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+ String resourceInputPrameters = resourceInputObj.getResourceParameters()
+ String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
+ JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
+ execution.setVariable(Prefix + "resourceRequestInputs", inputParameters)
+
+ //Deal with recipeParams
+ String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
+ String resourceName = resourceInputObj.getResourceInstanceName()
+ //For sdnc requestAction default is "createNetworkInstance"
+ String operationType = "Network"
+ if(!StringUtils.isBlank(recipeParamsFromRequest)){
+ //the operationType from worflow(first node) is second priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType")
+ }
+ if(!StringUtils.isBlank(recipeParamsFromWf)){
+ //the operationType from worflow(first node) is highest priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
+ }
+
+ execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
+ execution.setVariable("mso-request-id", requestId)
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex){
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ String customizeResourceParam(String networkInputParametersJson) {
+ List<Map<String, Object>> paramList = new ArrayList();
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson);
+ Iterator iterator = jsonObject.keys();
+ while (iterator.hasNext()) {
+ String key = iterator.next();
+ HashMap<String, String> hashMap = new HashMap();
+ hashMap.put("name", key);
+ hashMap.put("value", jsonObject.get(key))
+ paramList.add(hashMap)
+ }
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap();
+ paramMap.put("param", paramList);
+
+ return new JSONObject(paramMap).toString();
+ }
+
+ public void checkDevType(DelegateExecution execution){
+ utils.log("INFO"," ***** Started checkDevType *****")
+ try {
+
+ JSONObject inputParameters = execution.getVariable(Prefix + "resourceRequestInputs")
+
+ String devType = inputParameters.get("device_class")
+
+ if(StringUtils.isBlank(devType)) {
+ devType = "OTHER"
+ }
+
+ execution.setVariable("device_class", devType)
+
+ } catch (Exception ex){
+ String msg = "Exception in checkDevType " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void getVNFTemplatefromSDC(DelegateExecution execution){
+ utils.log("INFO"," ***** Started getVNFTemplatefromSDC *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void postVNFInfoProcess(DelegateExecution execution){
+ utils.log("INFO"," ***** Started postVNFInfoProcess *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ msoLogger.debug( " *** sendSyncResponse *** ")
+
+ try {
+ String operationStatus = "finished"
+ // RESTResponse for main flow
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ msoLogger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ msoLogger.debug(" ***** Exit sendSyncResopnse *****")
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index b5d196181b..4939173d65 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -466,6 +466,19 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
}
+ // if site location is in local Operator, create all resources in local ONAP;
+ // if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
+ public void doProcessSiteLocation(DelegateExecution execution){
+
+ msoLogger.trace("======== Start doProcessSiteLocation Process ======== ")
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ String uuiRequest = execution.getVariable("uuiRequest")
+ ServiceDecomposition serviceDecompositionforLocal = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
+ execution.setVariable("serviceDecomposition", serviceDecompositionforLocal)
+
+ msoLogger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
+ }
+
// prepare input param for using DoCreateResources.bpmn
public void preProcessForAddResource(DelegateExecution execution) {
msoLogger.trace("STARTED preProcessForAddResource Process ")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index 9591898ed0..d571c00f47 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -4,7 +4,7 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -183,9 +183,9 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
- execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
+ execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
msoLogger.info("Now we deal with resouce:" + currentResource.getModelInfo().getModelName())
- msoLogger.trace("COMPLETED getCurrentResoure Process ")
+ msoLogger.trace("COMPLETED getCurrentResoure Process ")
}
public void parseNextResource(DelegateExecution execution){
@@ -261,7 +261,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
} else {
String exceptionMessage = "Resource receipe is not found for resource modeluuid: " +
resourceInput.getResourceModelInfo().getModelUuid()
- utils.log("ERROR", exceptionMessage, isDebugEnabled)
+ msoLogger.trace(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, exceptionMessage)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
index 6d23ae7c65..76dba27890 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
@@ -330,11 +330,16 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
)){
jObj.put("resourceInstanceId", eValue)
}
- // for sp-partner
- if(rt == "sp-partner" && eKey.equals("sp-partner.id")) {
+ // for sp-partner and others
+ else if(eKey.equals(rt + ".id")){
jObj.put("resourceInstanceId", eValue)
- String sppartnerName = "sp-partner" + eValue
- jObj.put("resourceType", sppartnerName)
+ String resourceName = rt + eValue;
+ jObj.put("resourceType", resourceName)
+ }
+ else if(eKey.equals(rt + ".id")){
+ jObj.put("resourceInstanceId", eValue)
+ String resourceName = rt + eValue;
+ jObj.put("resourceType", resourceName)
}
}
@@ -412,6 +417,8 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if (serviceRelationShip != null) {
relationShipList = jsonSlurper.parseText(serviceRelationShip)
}
+
+ List<Resource> deleteRealResourceList = new ArrayList<Resource>();
//Set the real resource instance id to the decomosed resource list
for (Resource resource: deleteResourceList) {
@@ -421,13 +428,17 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if (relationShipList != null) {
relationShipList.each {
if (StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())) {
- resource.setResourceId(it.resourceInstanceId);
+ resource.setResourceId(it.resourceInstanceId)
+ deleteRealResourceList.add(resource)
}
}
}
}
- execution.setVariable("deleteResourceList", deleteResourceList)
- utils.log("DEBUG", "delete resource list : " + deleteResourceList, isDebugEnabled)
+
+ // only delete real existing resources
+ execution.setVariable("deleteResourceList", deleteRealResourceList)
+
+ utils.log("DEBUG", "delete resource list : " + deleteRealResourceList, isDebugEnabled)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage()
utils.log("DEBUG", exceptionMessage, isDebugEnabled)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
index bb490a06e4..61b1ca4cae 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
@@ -20,6 +20,7 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
+import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
@@ -30,12 +31,15 @@ public class InformDmaapClient implements JavaDelegate {
private DmaapClient dmaapClient;
@Override
- public void execute(DelegateExecution execution) throws Exception {
+ public void execute(DelegateExecution execution) {
String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID);
- dmaapClient.registerForUpdate(correlationId, () -> execution.getProcessEngineServices().getRuntimeService()
+ RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
+ dmaapClient.registerForUpdate(correlationId, () ->
+ runtimeService
.createMessageCorrelation("WorkflowMessage")
.processInstanceBusinessKey(execution.getProcessBusinessKey())
- .correlateWithResult());
+ .correlateWithResult()
+ );
}
@Autowired
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
index bd781756a5..7226feb552 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
@@ -20,6 +20,7 @@
package org.onap.so.bpmn.infrastructure.workflow.service;
+import org.json.JSONObject;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
@@ -27,7 +28,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-
+import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.client.HttpClient;
@@ -45,6 +46,7 @@ import org.apache.http.util.EntityUtils;
import org.camunda.bpm.engine.runtime.Execution;
import org.onap.so.bpmn.core.UrnPropertiesReader;
import org.onap.so.bpmn.core.domain.ServiceDecomposition;
+import org.onap.so.bpmn.core.domain.Resource;
import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
@@ -61,6 +63,8 @@ public class ServicePluginFactory {
public static final String OOF_Default_EndPoint = "http://192.168.1.223:8443/oof/sotncalc";
public static final String Third_SP_Default_EndPoint = "http://192.168.1.223:8443/sp/resourcemgr/querytps";
+
+ public static final String Inventory_OSS_Default_EndPoint = "http://192.168.1.199:8443/oss/inventory";
private static final int DEFAULT_TIME_OUT = 60000;
@@ -77,7 +81,15 @@ public class ServicePluginFactory {
}
return instance;
}
+
+ private ServicePluginFactory() {
+
+ }
+
+ private String getInventoryOSSEndPoint(){
+ return UrnPropertiesReader.getVariable("mso.service-plugin.inventory-oss-endpoint", Inventory_OSS_Default_EndPoint);
+ }
private String getThirdSPEndPoint(){
return UrnPropertiesReader.getVariable("mso.service-plugin.third-sp-endpoint", Third_SP_Default_EndPoint);
}
@@ -86,6 +98,60 @@ public class ServicePluginFactory {
return UrnPropertiesReader.getVariable("mso.service-plugin.oof-calc-endpoint", OOF_Default_EndPoint);
}
+ public ServiceDecomposition doProcessSiteLocation(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ ServiceDecomposition serviceDecompositionforLocal = serviceDecomposition;
+
+ if (isSiteLocationLocal(serviceDecomposition, uuiRequest)) {
+ return serviceDecomposition;
+ }
+
+ List<Resource> addResourceList = serviceDecomposition.getServiceResources();
+ for (Resource resource : addResourceList) {
+ String resourcemodelName = resource.getModelInfo().getModelName();
+ if (!StringUtils.containsIgnoreCase(resourcemodelName, "sp-partner")) {
+ serviceDecompositionforLocal.deleteResource(resource);
+ break;
+ }
+ if (!StringUtils.containsIgnoreCase(resourcemodelName, "sppartner")) {
+ serviceDecompositionforLocal.deleteResource(resource);
+ break;
+ }
+ }
+
+ return serviceDecompositionforLocal;
+ }
+
+ public boolean isSiteLocationLocal(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ boolean isSiteLocationLocal = true;
+
+ String serviceModelName = serviceDecomposition.getModelInfo().getModelName();
+ String serviceParameters = JsonUtils.getJsonValue(uuiRequest, "service.parameters");
+ String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs");
+ JSONObject inputParameters = new JSONObject(requestInputs);
+
+ if(StringUtils.containsIgnoreCase(serviceModelName, "site") && inputParameters.has("location"))
+ {
+ Object location = inputParameters.get("location");
+ JSONObject locationObj = new JSONObject(location);
+ String locationONAP = queryLocationFromInventoryOSS(locationObj);
+ if(StringUtils.containsIgnoreCase(locationONAP, "remote")) {
+ isSiteLocationLocal = false;
+ }
+ }
+
+ return isSiteLocationLocal;
+ }
+
+ private String queryLocationFromInventoryOSS(JSONObject locationObj) {
+ String reqContent = getJsonString(locationObj);
+ String url = getInventoryOSSEndPoint();
+ String responseContent = sendRequest(url, "POST", reqContent);
+ String locationONAP = "";
+ if (null != responseContent) {
+ locationONAP = getJsonObject(responseContent, String.class);
+ }
+ return locationONAP;
+ }
public String preProcessService(ServiceDecomposition serviceDecomposition, String uuiRequest) {
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn
new file mode 100644
index 0000000000..3e2c316ffc
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
+ <bpmn:process id="CreateDeviceResource.bpmn" name="CreateDeviceResource.bpmn" isExecutable="true">
+ <bpmn:endEvent id="EndEvent_1x6k78c" name="create Dev end">
+ <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def csi = new CreateDeviceResource.bpmn()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="ScriptTask_1g5zyi6" />
+ <bpmn:sequenceFlow id="SequenceFlow_0auvfvm" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:callActivity id="Task_0bga3e8" name="call Create SDNC Network Resource" calledElement="CreateSDNCNetworkResource">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1gu13by</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05niqbf</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:startEvent id="StartEvent_1vjxae6" name="createDev_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1rwaeun</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1caax8u" name="GoTo StartCreateDevinSDNC">
+ <bpmn:incoming>SequenceFlow_1ylvnxq</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:scriptTask id="ScriptTask_00y93jj" name="Check DevType" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0rq2jb1</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1hp2h5t</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.checkDevType(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_076ma0v">
+ <bpmn:incoming>SequenceFlow_1hp2h5t</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ss02ik</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0h4378g</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_076ma0v</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1chnlq6" name="GoTo StartCreateDevinSDNC">
+ <bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_02rli65">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "VNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1hp2h5t" sourceRef="ScriptTask_00y93jj" targetRef="ExclusiveGateway_0kba700" />
+ <bpmn:sequenceFlow id="SequenceFlow_0h4378g" name="PNF" sourceRef="ExclusiveGateway_0kba700" targetRef="IntermediateThrowEvent_1chnlq6">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "PNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1rwaeun" sourceRef="StartEvent_1vjxae6" targetRef="ScriptTask_14dav1d" />
+ <bpmn:scriptTask id="ScriptTask_14dav1d" name="Pre Process Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1rwaeun</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0rq2jb1</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.preProcessRequest(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0rq2jb1" sourceRef="ScriptTask_14dav1d" targetRef="ScriptTask_00y93jj" />
+ <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0slgrxw" name="StartCreateDevinSDNC">
+ <bpmn:outgoing>SequenceFlow_1gu13by</bpmn:outgoing>
+ <bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
+ </bpmn:intermediateCatchEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1gu13by" sourceRef="IntermediateCatchEvent_0slgrxw" targetRef="Task_0bga3e8" />
+ <bpmn:callActivity id="CallActivity_0pyrfca" name="call CreateVNF" calledElement="DoCreateVNF">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_0pg3072</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
+ <bpmn:endEvent id="EndEvent_0ymfq61">
+ <bpmn:incoming>SequenceFlow_076ma0v</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_076ma0v" sourceRef="ExclusiveGateway_0kba700" targetRef="EndEvent_0ymfq61" />
+ <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF Template fom SDC" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.getVNFTemplatefromSDC(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0pg3072" sourceRef="ScriptTask_02rli65" targetRef="CallActivity_0pyrfca" />
+ <bpmn:scriptTask id="ScriptTask_0u1piih" name="Post VNF info process " scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0pkp4ce</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ylvnxq</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateDeviceResource.bpmn">
+ <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
+ <dc:Bounds x="1026" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="994" y="153" width="75" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="494" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_05niqbf_di" bpmnElement="SequenceFlow_05niqbf">
+ <di:waypoint xsi:type="dc:Point" x="191" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="494" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="297.5" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0auvfvm_di" bpmnElement="SequenceFlow_0auvfvm">
+ <di:waypoint xsi:type="dc:Point" x="594" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="765" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0aywvn3_di" bpmnElement="Task_0bga3e8">
+ <dc:Bounds x="91" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="StartEvent_1vjxae6_di" bpmnElement="StartEvent_1vjxae6">
+ <dc:Bounds x="-188" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-211" y="-109" width="88" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1caax8u_di" bpmnElement="IntermediateThrowEvent_1caax8u">
+ <dc:Bounds x="1026" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1009" y="-104" width="78" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_00y93jj_di" bpmnElement="ScriptTask_00y93jj">
+ <dc:Bounds x="141" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0kba700_di" bpmnElement="ExclusiveGateway_0kba700" isMarkerVisible="true">
+ <dc:Bounds x="334" y="-152" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="309" y="-166" width="34" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1chnlq6_di" bpmnElement="IntermediateThrowEvent_1chnlq6">
+ <dc:Bounds x="341" y="-28" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="325" y="13" width="78" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ss02ik_di" bpmnElement="SequenceFlow_1ss02ik">
+ <di:waypoint xsi:type="dc:Point" x="384" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="480" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="420.94444444444446" y="-148" width="23" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1hp2h5t_di" bpmnElement="SequenceFlow_1hp2h5t">
+ <di:waypoint xsi:type="dc:Point" x="241" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="334" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="242.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0h4378g_di" bpmnElement="SequenceFlow_0h4378g">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-102" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-28" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="365" y="-67.27272727272728" width="22" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1rwaeun_di" bpmnElement="SequenceFlow_1rwaeun">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="-53" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-147.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_14dav1d_di" bpmnElement="ScriptTask_14dav1d">
+ <dc:Bounds x="-53" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0rq2jb1_di" bpmnElement="SequenceFlow_0rq2jb1">
+ <di:waypoint xsi:type="dc:Point" x="47" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="141" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="49" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_0slgrxw_di" bpmnElement="IntermediateCatchEvent_0slgrxw">
+ <dc:Bounds x="-188" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-203" y="147" width="79" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gu13by_di" bpmnElement="SequenceFlow_1gu13by">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="91" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-75.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0pyrfca_di" bpmnElement="CallActivity_0pyrfca">
+ <dc:Bounds x="662" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pkp4ce_di" bpmnElement="SequenceFlow_0pkp4ce">
+ <di:waypoint xsi:type="dc:Point" x="762" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="849" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="760.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_0ymfq61_di" bpmnElement="EndEvent_0ymfq61">
+ <dc:Bounds x="341" y="-251" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="359" y="-211" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_076ma0v_di" bpmnElement="SequenceFlow_076ma0v">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-215" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="374" y="-189.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
+ <dc:Bounds x="480" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pg3072_di" bpmnElement="SequenceFlow_0pg3072">
+ <di:waypoint xsi:type="dc:Point" x="580" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="662" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="621" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0u1piih_di" bpmnElement="ScriptTask_0u1piih">
+ <dc:Bounds x="849" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ylvnxq_di" bpmnElement="SequenceFlow_1ylvnxq">
+ <di:waypoint xsi:type="dc:Point" x="949" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="987.5" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn
new file mode 100644
index 0000000000..be15908697
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
+ <bpmn:process id="DeleteDeviceResource.bpmn" name="DeleteDeviceResource.bpmn" isExecutable="true">
+ <bpmn:endEvent id="EndEvent_1x6k78c" name="delete Dev end">
+ <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def csi = new DeleteDeviceResource.bpmn()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="ScriptTask_1g5zyi6" />
+ <bpmn:sequenceFlow id="SequenceFlow_0auvfvm" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:callActivity id="Task_0bga3e8" name="call Delete SDNC Network Resource" calledElement="DeleteSDNCNetworkResource">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1gu13by</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05niqbf</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:startEvent id="StartEvent_1vjxae6" name="deleteDev_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1rwaeun</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1caax8u" name="GoTo StartDeleteDevinSDNC">
+ <bpmn:incoming>SequenceFlow_1ylvnxq</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:scriptTask id="ScriptTask_00y93jj" name="Check DevType from AAI" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0rq2jb1</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1hp2h5t</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.checkDevType(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_076ma0v">
+ <bpmn:incoming>SequenceFlow_1hp2h5t</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ss02ik</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0h4378g</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_076ma0v</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1chnlq6" name="GoTo StartDeleteDevinSDNC">
+ <bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_02rli65">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "VNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1hp2h5t" sourceRef="ScriptTask_00y93jj" targetRef="ExclusiveGateway_0kba700" />
+ <bpmn:sequenceFlow id="SequenceFlow_0h4378g" name="PNF" sourceRef="ExclusiveGateway_0kba700" targetRef="IntermediateThrowEvent_1chnlq6">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "PNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1rwaeun" sourceRef="StartEvent_1vjxae6" targetRef="ScriptTask_14dav1d" />
+ <bpmn:scriptTask id="ScriptTask_14dav1d" name="Pre Process Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1rwaeun</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0rq2jb1</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.preProcessRequest(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0rq2jb1" sourceRef="ScriptTask_14dav1d" targetRef="ScriptTask_00y93jj" />
+ <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0slgrxw" name="StartDeleteDevinSDNC">
+ <bpmn:outgoing>SequenceFlow_1gu13by</bpmn:outgoing>
+ <bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
+ </bpmn:intermediateCatchEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1gu13by" sourceRef="IntermediateCatchEvent_0slgrxw" targetRef="Task_0bga3e8" />
+ <bpmn:callActivity id="CallActivity_0pyrfca" name="call DeleteVNF" calledElement="DoDeleteVNF">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_0pg3072</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
+ <bpmn:endEvent id="EndEvent_0ymfq61">
+ <bpmn:incoming>SequenceFlow_076ma0v</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_076ma0v" sourceRef="ExclusiveGateway_0kba700" targetRef="EndEvent_0ymfq61" />
+ <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF ID" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.getVNFTemplatefromSDC(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0pg3072" sourceRef="ScriptTask_02rli65" targetRef="CallActivity_0pyrfca" />
+ <bpmn:scriptTask id="ScriptTask_0u1piih" name="Post VNF info process " scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0pkp4ce</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ylvnxq</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteDeviceResource.bpmn">
+ <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
+ <dc:Bounds x="1026" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="994" y="153" width="75" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="494" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_05niqbf_di" bpmnElement="SequenceFlow_05niqbf">
+ <di:waypoint xsi:type="dc:Point" x="191" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="494" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="297.5" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0auvfvm_di" bpmnElement="SequenceFlow_0auvfvm">
+ <di:waypoint xsi:type="dc:Point" x="594" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="765" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0aywvn3_di" bpmnElement="Task_0bga3e8">
+ <dc:Bounds x="91" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="StartEvent_1vjxae6_di" bpmnElement="StartEvent_1vjxae6">
+ <dc:Bounds x="-188" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-211" y="-109" width="88" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1caax8u_di" bpmnElement="IntermediateThrowEvent_1caax8u">
+ <dc:Bounds x="1026" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1010" y="-104" width="77" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_00y93jj_di" bpmnElement="ScriptTask_00y93jj">
+ <dc:Bounds x="141" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0kba700_di" bpmnElement="ExclusiveGateway_0kba700" isMarkerVisible="true">
+ <dc:Bounds x="334" y="-152" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="309" y="-166" width="34" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1chnlq6_di" bpmnElement="IntermediateThrowEvent_1chnlq6">
+ <dc:Bounds x="341" y="-28" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="325" y="13" width="78" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ss02ik_di" bpmnElement="SequenceFlow_1ss02ik">
+ <di:waypoint xsi:type="dc:Point" x="384" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="480" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="420.94444444444446" y="-148" width="23" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1hp2h5t_di" bpmnElement="SequenceFlow_1hp2h5t">
+ <di:waypoint xsi:type="dc:Point" x="241" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="334" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="242.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0h4378g_di" bpmnElement="SequenceFlow_0h4378g">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-102" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-28" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="365" y="-67.27272727272728" width="22" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1rwaeun_di" bpmnElement="SequenceFlow_1rwaeun">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="-53" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-147.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_14dav1d_di" bpmnElement="ScriptTask_14dav1d">
+ <dc:Bounds x="-53" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0rq2jb1_di" bpmnElement="SequenceFlow_0rq2jb1">
+ <di:waypoint xsi:type="dc:Point" x="47" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="141" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="49" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_0slgrxw_di" bpmnElement="IntermediateCatchEvent_0slgrxw">
+ <dc:Bounds x="-188" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-203" y="147" width="78" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gu13by_di" bpmnElement="SequenceFlow_1gu13by">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="91" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-75.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0pyrfca_di" bpmnElement="CallActivity_0pyrfca">
+ <dc:Bounds x="662" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pkp4ce_di" bpmnElement="SequenceFlow_0pkp4ce">
+ <di:waypoint xsi:type="dc:Point" x="762" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="849" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="760.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_0ymfq61_di" bpmnElement="EndEvent_0ymfq61">
+ <dc:Bounds x="341" y="-251" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="359" y="-211" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_076ma0v_di" bpmnElement="SequenceFlow_076ma0v">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-215" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="374" y="-189.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
+ <dc:Bounds x="480" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pg3072_di" bpmnElement="SequenceFlow_0pg3072">
+ <di:waypoint xsi:type="dc:Point" x="580" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="662" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="621" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0u1piih_di" bpmnElement="ScriptTask_0u1piih">
+ <dc:Bounds x="849" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ylvnxq_di" bpmnElement="SequenceFlow_1ylvnxq">
+ <di:waypoint xsi:type="dc:Point" x="949" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="987.5" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
index eeaa5e451a..0b890d8573 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateE2EServiceInstanceV3" name="DoCreateE2EServiceInstanceV3" isExecutable="true">
<bpmn2:startEvent id="createSI_startEvent" name="Start Flow">
<bpmn2:outgoing>SequenceFlow_1qiiycn</bpmn2:outgoing>
@@ -76,7 +76,7 @@ ddsi.postProcessAAIPUT(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1qctzm0" sourceRef="Task_0uiekmn" targetRef="Task_0raqlqc" />
<bpmn2:scriptTask id="Task_0uiekmn" name="Prepare Resource Oper Status" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_03ebqhf</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1m2tm19</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1qctzm0</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
def ddsi = new DoCreateE2EServiceInstance()
@@ -158,16 +158,15 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script>
</bpmn2:intermediateCatchEvent>
<bpmn2:sequenceFlow id="SequenceFlow_1i7t9hq" sourceRef="IntermediateCatchEvent_0jrb3xu" targetRef="CustomE2EPutService" />
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_05dus9b" name="StartPrepareResource">
- <bpmn2:outgoing>SequenceFlow_1hbesp9</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_1m2tm19</bpmn2:outgoing>
<bpmn2:linkEventDefinition name="StartPrepareResource" />
</bpmn2:intermediateCatchEvent>
- <bpmn2:sequenceFlow id="SequenceFlow_1hbesp9" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="Task_0dqjp43" />
- <bpmn2:scriptTask id="Task_0ush1g4" name="Call Service OOF" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_01s0ef2</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_03ebqhf</bpmn2:outgoing>
+ <bpmn2:scriptTask id="Task_0ush1g4" name="Process Site Location" scriptFormat="groovy">
+ <bpmn2:incoming>SequenceFlow_13xfsff</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0y3i2k7</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi= new DoCreateE2EServiceInstance()
-dcsi.doServiceHoming(execution)]]></bpmn2:script>
+dcsi.doProcessSiteLocation(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:callActivity id="CallActivity_1ojtwas" name="Call DoCreateResources" calledElement="DoCreateResourcesV3">
<bpmn2:extensionElements>
@@ -191,7 +190,7 @@ dcsi.doServiceHoming(execution)]]></bpmn2:script>
<bpmn2:outgoing>SequenceFlow_0d0c20n</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:scriptTask id="ScriptTask_04b21gb" name="PreProcess for Add Resources" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_13xfsff</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_0y3i2k7</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0bf6bzp</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
def csi = new DoCreateE2EServiceInstance()
@@ -204,23 +203,16 @@ csi.preProcessForAddResource(execution)]]></bpmn2:script>
def csi = new DoCreateE2EServiceInstance()
csi.postProcessForAddResource(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_13xfsff" sourceRef="Task_0raqlqc" targetRef="ScriptTask_04b21gb" />
+ <bpmn2:sequenceFlow id="SequenceFlow_13xfsff" sourceRef="Task_0raqlqc" targetRef="Task_0ush1g4" />
<bpmn2:sequenceFlow id="SequenceFlow_0bf6bzp" sourceRef="ScriptTask_04b21gb" targetRef="CallActivity_1ojtwas" />
<bpmn2:sequenceFlow id="SequenceFlow_0d0c20n" sourceRef="CallActivity_1ojtwas" targetRef="ScriptTask_1y7jr4t" />
<bpmn2:endEvent id="EndEvent_0hzmoug">
<bpmn2:incoming>SequenceFlow_0a6vgsu</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_0a6vgsu" sourceRef="ScriptTask_1y7jr4t" targetRef="EndEvent_0hzmoug" />
- <bpmn2:sequenceFlow id="SequenceFlow_03ebqhf" sourceRef="Task_0ush1g4" targetRef="Task_0uiekmn" />
<bpmn2:sequenceFlow id="SequenceFlow_012h7yx" sourceRef="ScriptTask_1o01d7d" targetRef="IntermediateThrowEvent_1mlbhmt" />
- <bpmn2:sequenceFlow id="SequenceFlow_01s0ef2" sourceRef="Task_0dqjp43" targetRef="Task_0ush1g4" />
- <bpmn2:scriptTask id="Task_0dqjp43" name="Call Service Pre Operation" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_1hbesp9</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_01s0ef2</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def dcsi= new DoCreateE2EServiceInstance()
-dcsi.doServicePreOperation(execution)]]></bpmn2:script>
- </bpmn2:scriptTask>
+ <bpmn2:sequenceFlow id="SequenceFlow_1m2tm19" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="Task_0uiekmn" />
+ <bpmn2:sequenceFlow id="SequenceFlow_0y3i2k7" sourceRef="Task_0ush1g4" targetRef="ScriptTask_04b21gb" />
</bpmn2:process>
<bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
@@ -305,17 +297,17 @@ dcsi.doServicePreOperation(execution)]]></bpmn2:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1qctzm0_di" bpmnElement="SequenceFlow_1qctzm0">
- <di:waypoint xsi:type="dc:Point" x="534" y="300" />
- <di:waypoint xsi:type="dc:Point" x="604" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="226" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="337" y="300" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="524" y="279" width="90" height="12" />
+ <dc:Bounds x="236.5" y="279" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0v81r5h_di" bpmnElement="Task_0uiekmn">
- <dc:Bounds x="434" y="260" width="100" height="80" />
+ <dc:Bounds x="126" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_14tnuxf_di" bpmnElement="Task_0raqlqc">
- <dc:Bounds x="604" y="260" width="100" height="80" />
+ <dc:Bounds x="337" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateThrowEvent_11saqvj_di" bpmnElement="IntermediateThrowEvent_0bq4fxs">
<dc:Bounds x="1315" y="-207" width="36" height="36" />
@@ -418,37 +410,30 @@ dcsi.doServicePreOperation(execution)]]></bpmn2:script>
<dc:Bounds x="-3" y="318" width="82" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1hbesp9_di" bpmnElement="SequenceFlow_1hbesp9">
- <di:waypoint xsi:type="dc:Point" x="54" y="300" />
- <di:waypoint xsi:type="dc:Point" x="87" y="300" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="25.5" y="279" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0wr11dt_di" bpmnElement="Task_0ush1g4">
- <dc:Bounds x="277" y="260" width="100" height="80" />
+ <dc:Bounds x="554" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1ojtwas_di" bpmnElement="CallActivity_1ojtwas">
<dc:Bounds x="971" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_04b21gb_di" bpmnElement="ScriptTask_04b21gb">
- <dc:Bounds x="799" y="260" width="100" height="80" />
+ <dc:Bounds x="774" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1y7jr4t_di" bpmnElement="ScriptTask_1y7jr4t">
<dc:Bounds x="1145" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13xfsff_di" bpmnElement="SequenceFlow_13xfsff">
- <di:waypoint xsi:type="dc:Point" x="704" y="300" />
- <di:waypoint xsi:type="dc:Point" x="799" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="437" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="554" y="300" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="706.5" y="279" width="90" height="12" />
+ <dc:Bounds x="450.5" y="279" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0bf6bzp_di" bpmnElement="SequenceFlow_0bf6bzp">
- <di:waypoint xsi:type="dc:Point" x="899" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="874" y="300" />
<di:waypoint xsi:type="dc:Point" x="971" y="300" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="890" y="279" width="90" height="12" />
+ <dc:Bounds x="877.5" y="279" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0d0c20n_di" bpmnElement="SequenceFlow_0d0c20n">
@@ -471,13 +456,6 @@ dcsi.doServicePreOperation(execution)]]></bpmn2:script>
<dc:Bounds x="1235" y="279" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_03ebqhf_di" bpmnElement="SequenceFlow_03ebqhf">
- <di:waypoint xsi:type="dc:Point" x="377" y="300" />
- <di:waypoint xsi:type="dc:Point" x="434" y="300" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="405.5" y="278" width="0" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_012h7yx_di" bpmnElement="SequenceFlow_012h7yx">
<di:waypoint xsi:type="dc:Point" x="813" y="-39" />
<di:waypoint xsi:type="dc:Point" x="1315" y="-39" />
@@ -485,16 +463,20 @@ dcsi.doServicePreOperation(execution)]]></bpmn2:script>
<dc:Bounds x="1064" y="-61" width="0" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_01s0ef2_di" bpmnElement="SequenceFlow_01s0ef2">
- <di:waypoint xsi:type="dc:Point" x="187" y="300" />
- <di:waypoint xsi:type="dc:Point" x="277" y="300" />
+ <bpmndi:BPMNEdge id="SequenceFlow_1m2tm19_di" bpmnElement="SequenceFlow_1m2tm19">
+ <di:waypoint xsi:type="dc:Point" x="54" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="126" y="300" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="90" y="278" width="0" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0y3i2k7_di" bpmnElement="SequenceFlow_0y3i2k7">
+ <di:waypoint xsi:type="dc:Point" x="654" y="300" />
+ <di:waypoint xsi:type="dc:Point" x="774" y="300" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="232" y="278" width="0" height="14" />
+ <dc:Bounds x="714" y="278" width="0" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_1uhlqf5_di" bpmnElement="Task_0dqjp43">
- <dc:Bounds x="87" y="260" width="100" height="80" />
- </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
index aa865f0340..0b712452fd 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
@@ -96,6 +96,7 @@ public class VnfAdapterImpl {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "HeatStackId is missing from create VolumeGroup Vnf Adapter response.");
}
}
+ execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index 1d87b70754..515f04b218 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -178,6 +178,9 @@ public class VnfAdapterVfModuleObjectMapper {
if (requestContext.getUserParams() != null) {
paramsMap.putAll(requestContext.getUserParams());
}
+ if (vfModule.getCloudParams() != null) {
+ paramsMap.putAll(vfModule.getCloudParams());
+ }
return paramsMap;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/BaseClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/BaseClient.java
index 5a63d2097b..50137cf985 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/BaseClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/BaseClient.java
@@ -52,20 +52,19 @@ public class BaseClient<I,O> {
this.targetUrl = targetUrl;
}
- public O get(I data, Object... uriVariables) throws RestClientException {
- return run(data, HttpMethod.GET, uriVariables);
+ public O get(I data, ParameterizedTypeReference<O> typeRef, Object... uriVariables) throws RestClientException {
+ return run(data, HttpMethod.GET, typeRef, uriVariables);
}
- public O post(I data, Object... uriVariables) throws RestClientException {
- return run(data, HttpMethod.POST, uriVariables);
+ public O post(I data, ParameterizedTypeReference<O> typeRef, Object... uriVariables) throws RestClientException {
+ return run(data, HttpMethod.POST, typeRef, uriVariables);
}
- public O run(I data, HttpMethod method, Object... uriVariables) throws RestClientException {
+ public O run(I data, HttpMethod method, ParameterizedTypeReference<O> typeRef, Object... uriVariables) throws RestClientException {
HttpEntity<I> requestEntity = new HttpEntity<I>(data, getHttpHeader());
RestTemplate restTemplate = new RestTemplate();
restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory()));
- ParameterizedTypeReference<O> output = new ParameterizedTypeReference<O>() {};
- ResponseEntity<O> responseEntity = restTemplate.exchange(getTargetUrl(), method, requestEntity, output,
+ ResponseEntity<O> responseEntity = restTemplate.exchange(getTargetUrl(), method, requestEntity, typeRef,
uriVariables);
return responseEntity.getBody();
}
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 1f0d654a85..9e60196426 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
@@ -21,6 +21,7 @@
package org.onap.so.client.sdnc;
import java.util.LinkedHashMap;
+
import javax.ws.rs.core.UriBuilder;
import org.onap.so.client.exception.BadResponseException;
@@ -29,6 +30,7 @@ import org.onap.so.client.sdnc.beans.SDNCProperties;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
import org.onap.so.logger.MsoLogger;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;
@@ -58,7 +60,7 @@ public class SDNCClient {
HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth());
STOClient.setHttpHeader(httpHeader);
msoLogger.info("Running SDNC CLIENT for TargetUrl: " + targetUrl);
- LinkedHashMap<?, ?> output = STOClient.post(jsonRequest);
+ LinkedHashMap<?, ?> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<? ,?>>() {});
msoLogger.info("Validating output...");
return sdnCommonTasks.validateSDNResponse(output);
}
@@ -84,7 +86,7 @@ public class SDNCClient {
HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth());
STOClient.setHttpHeader(httpHeader);
msoLogger.info("Running SDNC CLIENT...");
- LinkedHashMap<?, ?> output = STOClient.get(jsonRequest);
+ LinkedHashMap<?, ?> output = STOClient.get(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<? ,?>>() {});
msoLogger.info("Validating output...");
return sdnCommonTasks.validateSDNGetResponse(output);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
index 99256fd507..af670d13d5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
@@ -128,6 +128,15 @@ public class VfModuleTopologyOperationRequestMapper {
}
}
+ if (vfModule.getCloudParams() != null) {
+ for (Map.Entry<String, String> entry : vfModule.getCloudParams().entrySet()) {
+ GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
+ paramItem.setName(entry.getKey());
+ paramItem.setValue(entry.getValue());
+ vfModuleInputParameters.addParamItem(paramItem);
+ }
+ }
+
if (volumeGroup != null) {
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName("volume-group-id");
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 979b9e5e80..cee94e28bd 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
@@ -31,6 +31,7 @@ import org.onap.so.client.sniro.beans.SniroConductorRequest;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
import org.onap.so.logger.MsoLogger;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
@@ -76,7 +77,7 @@ public class SniroClient {
baseClient.setTargetUrl(url);
baseClient.setHttpHeader(header);
- LinkedHashMap<?, ?> response = baseClient.post(homingRequest.toJsonString());
+ LinkedHashMap<?, ?> response = baseClient.post(homingRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<? ,?>>() {});
validator.validateDemandsResponse(response);
log.trace("Completed Sniro Client Post Demands");
}
@@ -106,7 +107,7 @@ public class SniroClient {
baseClient.setTargetUrl(url);
baseClient.setHttpHeader(header);
- LinkedHashMap<?, ?> response = baseClient.post(releaseRequest.toJsonString());
+ LinkedHashMap<?, ?> response = baseClient.post(releaseRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<? ,?>>() {});
SniroValidator v = new SniroValidator();
v.validateReleaseResponse(response);
log.trace("Completed Sniro Client Post Release");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
index 1bb59e7b8d..0c9e281fc7 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
@@ -103,6 +103,9 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
modelInfoVfModule.setModelUUID("vfModuleModelUuid");
modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
vfModule.setModelInfoVfModule(modelInfoVfModule);
+ HashMap<String, String> cloudParams = new HashMap<String, String>();
+ cloudParams.put("key3", "value3");
+ vfModule.setCloudParams(cloudParams);
CloudRegion cloudRegion = new CloudRegion();
cloudRegion.setLcpCloudRegionId("cloudRegionId");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/BaseClientTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/BaseClientTest.java
new file mode 100644
index 0000000000..a564d8a21d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/BaseClientTest.java
@@ -0,0 +1,50 @@
+package org.onap.so.client.sdnc;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertThat;
+
+import java.util.Map;
+
+import javax.ws.rs.core.UriBuilder;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.springframework.core.ParameterizedTypeReference;
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
+import wiremock.org.apache.http.entity.ContentType;
+public class BaseClientTest {
+
+
+ @Rule
+ public WireMockRule wm = new WireMockRule(options().dynamicPort());
+
+ @Test
+ public void verifyString() {
+ BaseClient<String, String> client = new BaseClient<>();
+ String response = "{\"hello\" : \"world\"}";
+ client.setTargetUrl(UriBuilder.fromUri("http://localhost/test").port(wm.port()).build().toString());
+ wm.stubFor(get(urlEqualTo("/test"))
+ .willReturn(aResponse().withStatus(200).withBody(response).withHeader("Content-Type", ContentType.APPLICATION_JSON.toString())));
+
+ String result = client.get("", new ParameterizedTypeReference<String>() {});
+ assertThat(result, equalTo(response));
+ }
+
+ @Test
+ public void verifyMap() {
+ BaseClient<String, Map<String, Object>> client = new BaseClient<>();
+ String response = "{\"hello\" : \"world\"}";
+ client.setTargetUrl(UriBuilder.fromUri("http://localhost/test").port(wm.port()).build().toString());
+ wm.stubFor(get(urlEqualTo("/test"))
+ .willReturn(aResponse().withStatus(200).withBody(response).withHeader("Content-Type", ContentType.APPLICATION_JSON.toString())));
+
+ Map<String, Object> result = client.get("", new ParameterizedTypeReference<Map<String, Object>>() {});
+ assertThat("world", equalTo(result.get("hello")));
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
index 369a7321e2..b3999a788c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
@@ -100,6 +100,9 @@ public class VfModuleTopologyOperationRequestMapperTest {
modelInfoVfModule.setModelUUID("vfModuleModelUuid");
modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
vfModule.setModelInfoVfModule(modelInfoVfModule);
+ HashMap<String, String> cloudParams = new HashMap<String, String>();
+ userParams.put("key2", "value2");
+ vfModule.setCloudParams(cloudParams);
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupId("volumeGroupId");
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json
index 0db327eae4..0132068fe4 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json
@@ -39,6 +39,7 @@
"fw_subint_ctrl_port_0_floating_v6_ip": "floatingIpV60",
"workload_context": "workloadContext",
"key1": "value2",
+ "key3": "value3",
"availability_zone_0": "zone0",
"availability_zone_1": "zone1",
"availability_zone_2": "zone2",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json
index 4231152d86..50d5642fee 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json
@@ -23,6 +23,10 @@
"value" : "value1"
},
{
+ "name" : "key2",
+ "value" : "value2"
+ },
+ {
"name" : "volume-group-id",
"value" : "volumeGroupId"
} ]
diff --git a/common/pom.xml b/common/pom.xml
index 0f1070309a..18b30a26bf 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -58,11 +58,6 @@
<version>4.3.6.Final</version>
</dependency>
<dependency>
- <groupId>com.wordnik</groupId>
- <artifactId>swagger-annotations_2.9.1</artifactId>
- <version>1.3.0</version>
- </dependency>
- <dependency>
<groupId>org.onap.appc.client</groupId>
<artifactId>client-kit</artifactId>
<version>1.3.0</version>
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestDetails.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestDetails.java
index d71334288e..0364043e8e 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestDetails.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestDetails.java
@@ -58,6 +58,8 @@ public class RequestDetails implements Serializable {
protected LineOfBusiness lineOfBusiness;
@JsonProperty("instanceName")
private List<Map<String, String>> instanceName = new ArrayList<>();
+ @JsonProperty("configurationParameters")
+ protected List<Map<String, String>> configurationParameters = new ArrayList<>();
/**
@@ -290,14 +292,20 @@ public class RequestDetails implements Serializable {
public void setInstanceName(List<Map<String, String>> instanceName) {
this.instanceName = instanceName;
}
+ public List<Map<String, String>> getConfigurationParameters() {
+ return configurationParameters;
+ }
+
+ public void setConfigurationParameters(List<Map<String, String>> configurationParameters) {
+ this.configurationParameters = configurationParameters;
+ }
+
@Override
public String toString() {
- return "RequestDetails [modelInfo=" + modelInfo + ", requestInfo="
- + requestInfo + ", relatedInstanceList="
- + Arrays.toString(relatedInstanceList) + ", subscriberInfo="
- + subscriberInfo + ", cloudConfiguration=" + cloudConfiguration
- + ", requestParameters=" + requestParameters + ", platform=" + platform
- + ", lineOfBusiness=" + ", project=" + project + ", owningEntity=" + owningEntity
- + ", instanceName" + instanceName + "]";
+ return "RequestDetails [modelInfo=" + modelInfo + ", requestInfo=" + requestInfo + ", relatedInstanceList="
+ + Arrays.toString(relatedInstanceList) + ", subscriberInfo=" + subscriberInfo + ", cloudConfiguration="
+ + cloudConfiguration + ", requestParameters=" + requestParameters + ", project=" + project
+ + ", owningEntity=" + owningEntity + ", platform=" + platform + ", lineOfBusiness=" + lineOfBusiness
+ + ", instanceName=" + instanceName + ", configurationParameters=" + configurationParameters + "]";
}
}
diff --git a/docs/Install_Configure_SO.rst b/docs/Install_Configure_SO.rst
index eb33b38dc2..e06385e39b 100644
--- a/docs/Install_Configure_SO.rst
+++ b/docs/Install_Configure_SO.rst
@@ -45,11 +45,11 @@ Guest IP: <leave blank>
Guest Port: 22
-.. image:: images/Configure_ubuntu_SO_1.png
+.. image:: ../images/Configure_ubuntu_SO_1.png
.
-.. image:: images/Configure_ubuntu_SO_2.png
+.. image:: ../images/Configure_ubuntu_SO_2.png
Create Shared Folder
--------------------
@@ -65,11 +65,11 @@ Auto-mount: <checked>
Read-only: <unchecked>
-.. image:: images/Configure_ubuntu_SO_3.png
+.. image:: ../images/Configure_ubuntu_SO_3.png
.
-.. image:: images/Configure_ubuntu_SO_4.png
+.. image:: ../images/Configure_ubuntu_SO_4.png
Install Ubuntu in the VM
------------------------
@@ -111,7 +111,7 @@ Connect to the VM from your host computer
-----------------------------------------
The PuTTY SSH client is popular. A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
-.. image:: images/Configure_ubuntu_SO_7.png
+.. image:: ../images/Configure_ubuntu_SO_7.png
Install VirtualBox Guest Additions
----------------------------------
@@ -140,7 +140,7 @@ Install the guest additions. NOTE: look for errors in the command output! If y
cd /media/cdrom
sudo ./VBoxLinuxAdditions.run
-.. image:: images/Configure_ubuntu_SO_9.png
+.. image:: ../images/Configure_ubuntu_SO_9.png
Add yourself to the vboxsf user group (replace "userid" with your user ID):
@@ -159,6 +159,6 @@ Further Reading
.. toctree::
:maxdepth: 1
- Install_Docker.rst
- Configure_git_and_gerrit.rst
- Workspace_and_Development_Tools.rst \ No newline at end of file
+ installconfigure/Install_Docker.rst
+ installconfigure/Configure_git_and_gerrit.rst
+ installconfigure/Workspace_and_Development_Tools.rst \ No newline at end of file
diff --git a/docs/SO_Interface.rst b/docs/api/SO_Interface.rst
index b7ab7be6f9..3ed18a5733 100644
--- a/docs/SO_Interface.rst
+++ b/docs/api/SO_Interface.rst
@@ -5,7 +5,7 @@
SO Interfaces
================================
-.. image:: images/SO_1.png
+.. image:: ../images/SO_1.png
SO APIs
=================================
diff --git a/docs/architecture.rst b/docs/architecture/architecture.rst
index e988632b96..754c6f888e 100644
--- a/docs/architecture.rst
+++ b/docs/architecture/architecture.rst
@@ -1,106 +1,112 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2018 Huawei Technologies Co., Ltd.
-
-SO - Architecture
-===============
-
-.. image:: images/SO_Architecture_1.png
-
-SO Sub-Components
-------------------
-
-**API Handler**
-
- RESTful interface to northbound clients
-
- * Handle service-level and infrastructure (VNF & network) requests
-
- Service-agnostic APIs
- * “Service Instantiation API”
-
- Model-driven recipe selection
- * Use SO Catalog to map input requests to BPMN flows
- * Dynamic lookup based on service-model + action
- * Input data forwarded to BPMN flow
-
- Track open and completed requests via SO Request DB
-
- Multiple API-H modules may support different APIs
-
-**BPMN Execution Engine**
-
- Open-source Camunda platform
- * Support BPMN 2.0 service recipes
-
- Expose RESTful interface to API-H (unique path per recipe)
-
- Make use of common “building block” sub-flows
-
- Sequence orchestration steps for each Resource in the recipe
- * Request and configure network resources via SDN-C
- * Manage cloud resources via PO (OpenStack)
- * Update inventory via A&AI
-
- Perform error handling/rollback
-
-**Resource Adapters**
-
- Interfaces to lower level controllers and other ONAP components
- * Platform Orchestrator, SDN-Controller, APP-Controller, VFC-Controllers
- * Hides the details of complex interfaces (e.g. OpenStack APIs)
- * Expose interfaces to BPMN flows as SOAP or REST APIs
- * Support synchronous and asynchronous operations
-
- Provided as part of SO platform for use by all BPMN flows
-
- Use SO Catalog to map resource requests to a recipe/template
-
- Data-driven design
- * Catalog templates may be updated via self-service (outside of release cycles)
- * Merge input parameters with templates at run-time
-
-**Data Stores**
-
- Request DB
- * Tracks open and completed requests
-
- SO Catalog
- * SO view of the SDC Catalog
- * service and resource models, recipes, and templates
- * Populated via SDC distribution service from TOSCA models
-
- Camunda DB
- * Maintain state for BPMN flows
- * Supports multiple active engines
-
-**SDC Distribution Client**
-
- Receive updated service models from SDC
- * Event-bus notifications when new models available
- * HTTP retrieval of models (TOSCA) and artifacts (Heat)
-
- Receive distributions as TOSCA models
-
- Populate SO Catalog
-
- Support self-service updates to models and artifacts
-
-Third Party and Open Source
----------------------------
-
-**BPMN Engine**
- Camunda (open source)
-
-**Other Open Source Components of Note:**
- JBOSS EAP/Wildfly
- MySQL/MariaDB
- Openstack Java SDK (“woorea”)
-
-
-
-
-
-
-
-
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2018 Huawei Technologies Co., Ltd.
+
+SO - Architecture
+===============
+
+.. image:: ../images/SO_Architecture_1.png
+
+SO Sub-Components
+------------------
+
+**API Handler**
+
+ RESTful interface to northbound clients
+
+ * Handle service-level and infrastructure (VNF & network) requests
+
+ Service-agnostic APIs
+ * “Service Instantiation API”
+
+ Model-driven recipe selection
+ * Use SO Catalog to map input requests to BPMN flows
+ * Dynamic lookup based on service-model + action
+ * Input data forwarded to BPMN flow
+
+ Track open and completed requests via SO Request DB
+
+ Multiple API-H modules may support different APIs
+
+**BPMN Execution Engine**
+
+ Open-source Camunda platform
+ * Support BPMN 2.0 service recipes
+
+ Expose RESTful interface to API-H (unique path per recipe)
+
+ Make use of common “building block” sub-flows
+
+ Sequence orchestration steps for each Resource in the recipe
+ * Request and configure network resources via SDN-C
+ * Manage cloud resources via PO (OpenStack)
+ * Update inventory via A&AI
+
+ Perform error handling/rollback
+
+**Resource Adapters**
+
+ Interfaces to lower level controllers and other ONAP components
+ * Platform Orchestrator, SDN-Controller, APP-Controller, VFC-Controllers
+ * Hides the details of complex interfaces (e.g. OpenStack APIs)
+ * Expose interfaces to BPMN flows as SOAP or REST APIs
+ * Support synchronous and asynchronous operations
+
+ Provided as part of SO platform for use by all BPMN flows
+
+ Use SO Catalog to map resource requests to a recipe/template
+
+ Data-driven design
+ * Catalog templates may be updated via self-service (outside of release cycles)
+ * Merge input parameters with templates at run-time
+
+**Data Stores**
+
+ Request DB
+ * Tracks open and completed requests
+
+ SO Catalog
+ * SO view of the SDC Catalog
+ * service and resource models, recipes, and templates
+ * Populated via SDC distribution service from TOSCA models
+
+ Camunda DB
+ * Maintain state for BPMN flows
+ * Supports multiple active engines
+
+**SDC Distribution Client**
+
+ Receive updated service models from SDC
+ * Event-bus notifications when new models available
+ * HTTP retrieval of models (TOSCA) and artifacts (Heat)
+
+ Receive distributions as TOSCA models
+
+ Populate SO Catalog
+
+ Support self-service updates to models and artifacts
+
+** SO Monitoring**
+ Monitor BPMN Workflow execution by providing
+ * Service list search based on search criteria
+ * Service statistic
+ * Service Process Instance Rendering and Detail
+
+Third Party and Open Source
+---------------------------
+
+**BPMN Engine**
+ Camunda (open source)
+
+**Other Open Source Components of Note:**
+ Tomcat
+ MySQL/MariaDB
+ Openstack Java SDK (“woorea”)
+
+
+
+
+
+
+
+
diff --git a/docs/BPMN_Main_Process_Flows.rst b/docs/bpmn/BPMN_Main_Process_Flows.rst
index abc006e813..43e08ffd9c 100644
--- a/docs/BPMN_Main_Process_Flows.rst
+++ b/docs/bpmn/BPMN_Main_Process_Flows.rst
@@ -1,40 +1,40 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-BPMN Main Process Flows
-========================
-
-Characteristics
-----------------
-
-**Invoked by an API Handler**
-
- The BPMN application (war) exposes a REST endpoint to which the API Handler(s) send requests for flow execution. The message sent by the API Handler to this endpoint is a JSON wrapper containing:
-
- * The original request received by the API handler from the portal or other client.
- * Metadata such as the request-id generated by the API Handler for the request.
- * The name of the BPMN process to execute (obtained by the API Handler from the mso_catalog.service_recipe table.
-
-**Asynchronous Service Model**
-
- All main process flows implement an asynchronous service model. The connection to the API Handler is kept open until the main process flow sends back a response. In the flow shown below, this is done by the "Send Sync Ack Response" script task. A flow is expected to send a response after validating the request, but before performing any long running tasks or tasks that could cause the process to be suspended.
-
- After the synchronous response is sent, the flow continues to execute. When the flow ends, it may optionally send an asynchronous notification to a callback URL provided in the original request (behavior depends on the API agreement)
-
-**Typically calls one or more subprocess flows**
-
- Main process flows usually implement the high-level service logic, delegating the "real" work to reusable subflows (Building Blocks) or custom subflows
-
-**Handles "Completion" and "Fallout" tasks**
-
- "Completion" tasks are those that occur when the process ends successfully, and "Fallout" tasks are those that occur when the process fails. Activities include:
-
- * Updating the mso_requests database.
- * Rolling back uncompleted work.
- * Sending an asynchronous callback notification.
-
-Example: CreateVfModuleVolumeInfraV1.bpmn
-------------------------------------------
-
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Main Process Flows
+========================
+
+Characteristics
+----------------
+
+**Invoked by an API Handler**
+
+ The BPMN application (war) exposes a REST endpoint to which the API Handler(s) send requests for flow execution. The message sent by the API Handler to this endpoint is a JSON wrapper containing:
+
+ * The original request received by the API handler from the portal or other client.
+ * Metadata such as the request-id generated by the API Handler for the request.
+ * The name of the BPMN process to execute (obtained by the API Handler from the mso_catalog.service_recipe table.
+
+**Asynchronous Service Model**
+
+ All main process flows implement an asynchronous service model. The connection to the API Handler is kept open until the main process flow sends back a response. In the flow shown below, this is done by the "Send Sync Ack Response" script task. A flow is expected to send a response after validating the request, but before performing any long running tasks or tasks that could cause the process to be suspended.
+
+ After the synchronous response is sent, the flow continues to execute. When the flow ends, it may optionally send an asynchronous notification to a callback URL provided in the original request (behavior depends on the API agreement)
+
+**Typically calls one or more subprocess flows**
+
+ Main process flows usually implement the high-level service logic, delegating the "real" work to reusable subflows (Building Blocks) or custom subflows
+
+**Handles "Completion" and "Fallout" tasks**
+
+ "Completion" tasks are those that occur when the process ends successfully, and "Fallout" tasks are those that occur when the process fails. Activities include:
+
+ * Updating the mso_requests database.
+ * Rolling back uncompleted work.
+ * Sending an asynchronous callback notification.
+
+Example: CreateVfModuleVolumeInfraV1.bpmn
+------------------------------------------
+
.. image:: images/BPMN_Main_Process_Flows_1.png \ No newline at end of file
diff --git a/docs/BPMN_Project_Deployment_Strategy.rst b/docs/bpmn/BPMN_Project_Deployment_Strategy.rst
index 50f48363ed..50f48363ed 100644
--- a/docs/BPMN_Project_Deployment_Strategy.rst
+++ b/docs/bpmn/BPMN_Project_Deployment_Strategy.rst
diff --git a/docs/BPMN_Project_Structure.rst b/docs/bpmn/BPMN_Project_Structure.rst
index 3c5ccc3e7d..209ec727c3 100644
--- a/docs/BPMN_Project_Structure.rst
+++ b/docs/bpmn/BPMN_Project_Structure.rst
@@ -1,47 +1,47 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-BPMN Project Structure
-=======================
-
-BPMN main process flow
-----------------------
-
-A BPMN main process flow is a top-level flow. All main process flows are under the src/main/resources/process folder.
-
-CreateVfModuleVolumeInfraV1 is a main process flow.
-
-.. image:: images/bpmn_project_structure_1.png
-
-Open BPMN files with the camunda modeler (standalone application). To launch the modeler from eclipse, right-click→open-with→Other→Browse. Select Check the boxes on the dialog so that eclipse will open all .bpmn files with the camunda-modeler executable.
-
-BPMN subprocess flow
----------------------
-
-A BPMN subprocess flow is meant to be invoked by other flows (either main process flows or other subprocess flows). All subprocess flows are under the src/main/resources/subprocess folder.
-
-The CreateVfModuleVolumeInfraV1 process flow is delivered with two custom subflows: DoCreateVfModuleVolumeV2 and DoCreateVfModuleVolumeRollback.
-
-.. image:: images/bpmn_project_structure_2.png
-
-Groovy scripts
----------------
-
-There is one groovy script for each BPMN file. Groovy scripts are invoked by script tasks within the BPMN flows.
-
-.. image:: images/bpmn_project_structure_3.png
-
-Unit Tests
------------
-
-Normally, we create a unit test class for every flow. This one is missing a unit test for its rollback flow.
-
-.. image:: images/bpmn_project_structure_4.png
-
-Unit Test Resource Files
-------------------------
-
-Any files needed by the unit tests are kept under the src/test/resources/__files folder.
-
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Project Structure
+=======================
+
+BPMN main process flow
+----------------------
+
+A BPMN main process flow is a top-level flow. All main process flows are under the src/main/resources/process folder.
+
+CreateVfModuleVolumeInfraV1 is a main process flow.
+
+.. image:: images/bpmn_project_structure_1.png
+
+Open BPMN files with the camunda modeler (standalone application). To launch the modeler from eclipse, right-click→open-with→Other→Browse. Select Check the boxes on the dialog so that eclipse will open all .bpmn files with the camunda-modeler executable.
+
+BPMN subprocess flow
+---------------------
+
+A BPMN subprocess flow is meant to be invoked by other flows (either main process flows or other subprocess flows). All subprocess flows are under the src/main/resources/subprocess folder.
+
+The CreateVfModuleVolumeInfraV1 process flow is delivered with two custom subflows: DoCreateVfModuleVolumeV2 and DoCreateVfModuleVolumeRollback.
+
+.. image:: images/bpmn_project_structure_2.png
+
+Groovy scripts
+---------------
+
+There is one groovy script for each BPMN file. Groovy scripts are invoked by script tasks within the BPMN flows.
+
+.. image:: images/bpmn_project_structure_3.png
+
+Unit Tests
+-----------
+
+Normally, we create a unit test class for every flow. This one is missing a unit test for its rollback flow.
+
+.. image:: images/bpmn_project_structure_4.png
+
+Unit Test Resource Files
+------------------------
+
+Any files needed by the unit tests are kept under the src/test/resources/__files folder.
+
.. image:: images/bpmn_project_structure_5.png \ No newline at end of file
diff --git a/docs/BPMN_Subprocess_Process_Flows.rst b/docs/bpmn/BPMN_Subprocess_Process_Flows.rst
index fc36cc54c9..098f38ff02 100644
--- a/docs/BPMN_Subprocess_Process_Flows.rst
+++ b/docs/bpmn/BPMN_Subprocess_Process_Flows.rst
@@ -1,32 +1,32 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-BPMN Subprocess Process Flows
-==============================
-
-Characteristics
-----------------
-
-**Invoked by other flows**
-
- A BPMN Call_Activity_ provides the mechanism to invoke subprocess flows. The Called Element attribute of the Call Activity specifies the name of the subprocess to execute.
-
-.. _Call_Activity: https://docs.camunda.org/manual/7.7/reference/bpmn20/subprocesses/call-activity/
-
-**Input and Output variable mapping**
-
- In the modeler, you can specify a list of "In Mappings". With this, you can map execution variables from the calling flow to the subprocess. The subprocess always has its own copy of each variable. To transfer values back to the calling flow, you specify "Out Mappings".
-
-**May throw MSOWorkflowException**
-
- The current best practice for reporting errors from subprocess is described here:
-
- * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.
- * The WorkflowException object contains an error code and an error message.
- * The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.
-
-Example: VnfAdapterRestV1.bpmn
--------------------------------
-
-.. image:: images/BPMN_Subprocess_process_flows_1.png
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Subprocess Process Flows
+==============================
+
+Characteristics
+----------------
+
+**Invoked by other flows**
+
+ A BPMN Call_Activity_ provides the mechanism to invoke subprocess flows. The Called Element attribute of the Call Activity specifies the name of the subprocess to execute.
+
+.. _Call_Activity: https://docs.camunda.org/manual/7.7/reference/bpmn20/subprocesses/call-activity/
+
+**Input and Output variable mapping**
+
+ In the modeler, you can specify a list of "In Mappings". With this, you can map execution variables from the calling flow to the subprocess. The subprocess always has its own copy of each variable. To transfer values back to the calling flow, you specify "Out Mappings".
+
+**May throw MSOWorkflowException**
+
+ The current best practice for reporting errors from subprocess is described here:
+
+ * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.
+ * The WorkflowException object contains an error code and an error message.
+ * The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.
+
+Example: VnfAdapterRestV1.bpmn
+-------------------------------
+
+.. image:: images/BPMN_Subprocess_process_flows_1.png
diff --git a/docs/Camunda_Cockpit_Community_Edition.rst b/docs/bpmn/Camunda_Cockpit_Community_Edition.rst
index a9379decc9..a9379decc9 100644
--- a/docs/Camunda_Cockpit_Community_Edition.rst
+++ b/docs/bpmn/Camunda_Cockpit_Community_Edition.rst
diff --git a/docs/Camunda_Cockpit_Enterprise_Edition.rst b/docs/bpmn/Camunda_Cockpit_Enterprise_Edition.rst
index 3e2d15bf15..3e2d15bf15 100644
--- a/docs/Camunda_Cockpit_Enterprise_Edition.rst
+++ b/docs/bpmn/Camunda_Cockpit_Enterprise_Edition.rst
diff --git a/docs/Camunda_Modeler.rst b/docs/bpmn/Camunda_Modeler.rst
index e2ff06d595..54f3534210 100644
--- a/docs/Camunda_Modeler.rst
+++ b/docs/bpmn/Camunda_Modeler.rst
@@ -1,19 +1,19 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-Camunda Modeler
-=================
-
-The Camunda_Modeler_ is the editor for BPMN 2.0 process flows. It is a standalone application. NOTE: the Camunda eclipse plugin is no longer supported and should not be used.
-
-.. _Camunda_Modeler: https://docs.camunda.org/manual/latest/modeler/camunda-modeler/
-
-.. image:: images/camunda_modeler_1.png
-
-Modeler Templates
-------------------
-
-Some work has already been done in MSO to develop templates_ for "building block" subprocess flows. When a template is provided for a BPMN element, the modeler displays a custom form for inputting parameters. This significantly simplifies flow construction and reduces the chance of making mistakes.
-
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Modeler
+=================
+
+The Camunda_Modeler_ is the editor for BPMN 2.0 process flows. It is a standalone application. NOTE: the Camunda eclipse plugin is no longer supported and should not be used.
+
+.. _Camunda_Modeler: https://docs.camunda.org/manual/latest/modeler/camunda-modeler/
+
+.. image:: images/camunda_modeler_1.png
+
+Modeler Templates
+------------------
+
+Some work has already been done in MSO to develop templates_ for "building block" subprocess flows. When a template is provided for a BPMN element, the modeler displays a custom form for inputting parameters. This significantly simplifies flow construction and reduces the chance of making mistakes.
+
.. _templates: https://docs.camunda.org/manual/7.7/modeler/camunda-modeler/element-templates/ \ No newline at end of file
diff --git a/docs/index.rst b/docs/index.rst
index 86b6447017..553b7f4cbc 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -8,8 +8,8 @@ ONAP SO
.. toctree::
:maxdepth: 1
- Install_Configure_SO.rst
- architecture.rst
+ installconfigure/Install_Configure_SO.rst
+ architecture/architecture.rst
offered_consumed_apis.rst
developer_information.rst
release-notes.rst \ No newline at end of file
diff --git a/docs/Configure_git_and_gerrit.rst b/docs/installconfigure/Configure_git_and_gerrit.rst
index c4598faf7b..c4598faf7b 100644
--- a/docs/Configure_git_and_gerrit.rst
+++ b/docs/installconfigure/Configure_git_and_gerrit.rst
diff --git a/docs/Install_Docker.rst b/docs/installconfigure/Install_Docker.rst
index 22a76a4fbf..91e40ca138 100644
--- a/docs/Install_Docker.rst
+++ b/docs/installconfigure/Install_Docker.rst
@@ -1,85 +1,85 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2018 Huawei Technologies Co., Ltd.
-
-Install Docker
-===============
-
-Make sure curl is installed on the Ubuntu VM:
-
-.. code-block:: bash
-
- sudo apt update
- sudo apt install curl
-
-If you are behind a corporate firewall (replace "proxyhost:port" with your actual proxy information)
- https_proxy="https://*proxyhost:port*" curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
-
-Otherwise:
- curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
-Expected Response:
- OK
-Add the docker package repository:
- sudo apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main"
-
-Install packages:
-
-.. code-block:: bash
-
- sudo apt update
- sudo apt-cache policy docker-engine
- sudo apt install docker-engine
- sudo apt install docker-compose
-
-If you are behind a corporate firewall, you will need to configure proxy settings for docker so that images may be obtained from internet repositories. In the commands shown here, replace *"proxyhost:port"*, *"yourdomain1.com"*, and *"yourdomain2.com"* with appropriate values.
-
- Make the docker configuration directory:
-
-.. code-block:: bash
-
- sudo mkdir -p /etc/systemd/system/docker.service.d
-
- Edit (create) this file:
-
-.. code-block:: bash
-
- sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
-
- Add these lines:
-
- [Service]
-
- Environment="HTTP_PROXY=https://*proxyhost:port*"
-
- Environment="HTTPS_PROXY=https://*proxyhost:port*"
-
- Environment="NO_PROXY=localhost,127.0.0.1,.yourdomain1.com,.yourdomain2.com"
-
- Restart docker:
-
-.. code-block:: bash
-
- sudo systemctl daemon-reload
- sudo systemctl restart docker
-
-Add yourself to the docker user group (replace "userid" with your user ID):
-
-.. code-block:: bash
-
- sudo usermod -a -G docker *userid*
-
-Log out and log back in so that the user group change will takeeffect.
-
-Verify that you can connect to docker as yourself (i.e. not as root):
-
-.. code-block:: bash
-
- docker ps
-
-Verify that you can download and run the hello-world container
-
-.. code-block:: bash
-
- docker run hello-world
-
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2018 Huawei Technologies Co., Ltd.
+
+Install Docker
+===============
+
+Make sure curl is installed on the Ubuntu VM:
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt install curl
+
+If you are behind a corporate firewall (replace "proxyhost:port" with your actual proxy information)
+ https_proxy="https://*proxyhost:port*" curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
+
+Otherwise:
+ curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
+Expected Response:
+ OK
+Add the docker package repository:
+ sudo apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main"
+
+Install packages:
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt-cache policy docker-engine
+ sudo apt install docker-engine
+ sudo apt install docker-compose
+
+If you are behind a corporate firewall, you will need to configure proxy settings for docker so that images may be obtained from internet repositories. In the commands shown here, replace *"proxyhost:port"*, *"yourdomain1.com"*, and *"yourdomain2.com"* with appropriate values.
+
+ Make the docker configuration directory:
+
+.. code-block:: bash
+
+ sudo mkdir -p /etc/systemd/system/docker.service.d
+
+ Edit (create) this file:
+
+.. code-block:: bash
+
+ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
+
+ Add these lines:
+
+ [Service]
+
+ Environment="HTTP_PROXY=https://*proxyhost:port*"
+
+ Environment="HTTPS_PROXY=https://*proxyhost:port*"
+
+ Environment="NO_PROXY=localhost,127.0.0.1,.yourdomain1.com,.yourdomain2.com"
+
+ Restart docker:
+
+.. code-block:: bash
+
+ sudo systemctl daemon-reload
+ sudo systemctl restart docker
+
+Add yourself to the docker user group (replace "userid" with your user ID):
+
+.. code-block:: bash
+
+ sudo usermod -a -G docker *userid*
+
+Log out and log back in so that the user group change will takeeffect.
+
+Verify that you can connect to docker as yourself (i.e. not as root):
+
+.. code-block:: bash
+
+ docker ps
+
+Verify that you can download and run the hello-world container
+
+.. code-block:: bash
+
+ docker run hello-world
+
.. image:: images/Docker_install_1.png \ No newline at end of file
diff --git a/docs/Workspace_and_Development_Tools.rst b/docs/installconfigure/Workspace_and_Development_Tools.rst
index 2012a20b09..598439f75f 100644
--- a/docs/Workspace_and_Development_Tools.rst
+++ b/docs/installconfigure/Workspace_and_Development_Tools.rst
@@ -1,107 +1,107 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-Workspace and Development Tools
-===============================
-
-We recognize that there are different ways to set up a workspace and different tools that may be chosen. This is just one way to set things up.
-
-Suggested Directory Structure
-------------------------------
-*NOTE*: You may have different versions of eclipse and java.
-
- onap
-
- .m2
-
- apache-maven-3.3.9
-
- camunda-modeler
-
- eclipse-jee-neon-3-linux-gtk-x86_64
-
- jdk1.8.0_131
-
- workspace
-
- SO
- chef-repo
-
- docker-config
-
- libs
-
- so
-
- so-config
-
-Java
------
-Download the latest Java_8_SE_Development_Kit_ from Oracle. Select a Linux x64 package.
-
-Unpack it.
-
-.. _Java_8_SE_Development_Kit: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
-
-Maven
-------
-
-Download the Apache_Maven_3.3.9_ binary. NOTE: 3.3.9 is the recommended version, even though much higher versions are available.
-
-Unpack it.
-
-.. _Apache_Maven_3.3.9: https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/
-
-Create an .m2 directory for maven and put settings.xml_ in it. Edit the local repository path in settings.xml to make it correct for your environment. Everything else should be OK.
-
-.. _settings.xml: https://wiki.onap.org/download/attachments/15997820/settings.xml?version=1&modificationDate=1506156303000&api=v2
-
-Camunda Modeler
----------------
-
-Download the Camunda_Modeler_. Select the Linux x64 package.
-Unpack it.
-
-.. _Camunda_Modeler: https://camunda.org/download/modeler/
-
-Eclipse
--------
-
-Download Eclipse_for_Linux_. Select the 64-bit Eclipse IDE for Java EE Developers. Oxygen seems to be the latest version. These instructions were written for Neon.
-Unpack it.
-
-.. _Eclipse_for_Linux: https://www.eclipse.org/downloads/eclipse-packages/?osType=linux
-
-In the eclipse directory, edit eclipse.ini
-
- Add (or change) the -vm setting so that it points to your JDK.
-
- Adjust the maximum heap space (2GB is recommended).
-
- Example:
-
-.. image:: images/Workspace_and_Development_Tools.png
-
-Eclipse Settings
-----------------
-
-**Configure eclipse to use your external maven 3.3.9 installation:**
- Go to Window→Preferences→Maven→Installations
-
- Click "Add" and browse to your apache-maven-3.3.9 directory. Click "OK" to select it.
-
- Click "Finish"
-
-.. image:: images/Workspace_and_Development_Tools_2.png
-
-Make sure the external installation is selected:
-
-.. image:: images/Workspace_and_Development_Tools_3.png
-
-**Configure eclipse to use your settings.xml**
- Go to Window→Preferences→Maven→User Settings
-
- Type the full path to your settings.xml file into the "User Settings" box and click "OK".
-
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Workspace and Development Tools
+===============================
+
+We recognize that there are different ways to set up a workspace and different tools that may be chosen. This is just one way to set things up.
+
+Suggested Directory Structure
+------------------------------
+*NOTE*: You may have different versions of eclipse and java.
+
+ onap
+
+ .m2
+
+ apache-maven-3.3.9
+
+ camunda-modeler
+
+ eclipse-jee-neon-3-linux-gtk-x86_64
+
+ jdk1.8.0_131
+
+ workspace
+
+ SO
+ chef-repo
+
+ docker-config
+
+ libs
+
+ so
+
+ so-config
+
+Java
+-----
+Download the latest Java_8_SE_Development_Kit_ from Oracle. Select a Linux x64 package.
+
+Unpack it.
+
+.. _Java_8_SE_Development_Kit: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
+
+Maven
+------
+
+Download the Apache_Maven_3.3.9_ binary. NOTE: 3.3.9 is the recommended version, even though much higher versions are available.
+
+Unpack it.
+
+.. _Apache_Maven_3.3.9: https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/
+
+Create an .m2 directory for maven and put settings.xml_ in it. Edit the local repository path in settings.xml to make it correct for your environment. Everything else should be OK.
+
+.. _settings.xml: https://wiki.onap.org/download/attachments/15997820/settings.xml?version=1&modificationDate=1506156303000&api=v2
+
+Camunda Modeler
+---------------
+
+Download the Camunda_Modeler_. Select the Linux x64 package.
+Unpack it.
+
+.. _Camunda_Modeler: https://camunda.org/download/modeler/
+
+Eclipse
+-------
+
+Download Eclipse_for_Linux_. Select the 64-bit Eclipse IDE for Java EE Developers. Oxygen seems to be the latest version. These instructions were written for Neon.
+Unpack it.
+
+.. _Eclipse_for_Linux: https://www.eclipse.org/downloads/eclipse-packages/?osType=linux
+
+In the eclipse directory, edit eclipse.ini
+
+ Add (or change) the -vm setting so that it points to your JDK.
+
+ Adjust the maximum heap space (2GB is recommended).
+
+ Example:
+
+.. image:: images/Workspace_and_Development_Tools.png
+
+Eclipse Settings
+----------------
+
+**Configure eclipse to use your external maven 3.3.9 installation:**
+ Go to Window→Preferences→Maven→Installations
+
+ Click "Add" and browse to your apache-maven-3.3.9 directory. Click "OK" to select it.
+
+ Click "Finish"
+
+.. image:: images/Workspace_and_Development_Tools_2.png
+
+Make sure the external installation is selected:
+
+.. image:: images/Workspace_and_Development_Tools_3.png
+
+**Configure eclipse to use your settings.xml**
+ Go to Window→Preferences→Maven→User Settings
+
+ Type the full path to your settings.xml file into the "User Settings" box and click "OK".
+
.. image:: images/Workspace_and_Development_Tools_4.png \ No newline at end of file
diff --git a/docs/offered_consumed_apis.rst b/docs/offered_consumed_apis.rst
index f18b5bdd60..78f531db61 100644
--- a/docs/offered_consumed_apis.rst
+++ b/docs/offered_consumed_apis.rst
@@ -12,4 +12,4 @@ All the Service Orchestrator APIs, both inward and outward are documented in the
.. toctree::
:maxdepth: 1
- SO_Interface.rst
+ api/SO_Interface.rst
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
index 3eee14e3bf..5b08cc1b17 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
@@ -42,5 +42,6 @@ public enum Action implements Actions{
unassignInstance,
compareModel,
scaleInstance,
- deactivateAndCloudDelete
+ deactivateAndCloudDelete,
+ scaleOut
}
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 e8a6beb278..923909e39b 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
@@ -73,8 +73,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
@Component
@Path("/e2eServiceInstances")
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 4d8c4ffbd8..dcfe40aa51 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
@@ -61,7 +61,8 @@ import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
-import com.wordnik.swagger.annotations.ApiOperation;
+
+import io.swagger.annotations.ApiOperation;
@Path("/tasks")
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
index 38b3dd6054..66afcf3738 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
@@ -44,6 +44,7 @@ import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandlerinfra.tasksbeans.TasksRequest;
import org.onap.so.apihandlerinfra.validation.ApplyUpdatedConfigValidation;
import org.onap.so.apihandlerinfra.validation.CloudConfigurationValidation;
+import org.onap.so.apihandlerinfra.validation.ConfigurationParametersValidation;
import org.onap.so.apihandlerinfra.validation.InPlaceSoftwareUpdateValidation;
import org.onap.so.apihandlerinfra.validation.InstanceIdMapValidation;
import org.onap.so.apihandlerinfra.validation.ModelInfoValidation;
@@ -178,6 +179,7 @@ public class MsoRequest {
rules.add(new PlatformLOBValidation());
rules.add(new ProjectOwningEntityValidation());
rules.add(new RelatedInstancesValidation());
+ rules.add(new ConfigurationParametersValidation());
}
if(reqVersion >= 7 && requestParameters != null && requestParameters.getUserParams() != null){
for(Map<String, Object> params : requestParameters.getUserParams()){
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 b241a5136e..ced69df55c 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
@@ -525,6 +525,21 @@ public class ServiceInstances {
Response response = serviceInstances(request, Action.deactivateAndCloudDelete, instanceIdMap, version, requestId, getRequestUri(requestContext));
return response;
}
+
+ @POST
+ @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)
+ @Transactional
+ public Response scaleOutVfModule(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId,
+ @PathParam("vnfInstanceId") String vnfInstanceId, @Context ContainerRequestContext requestContext) throws ApiException {
+ String requestId = getRequestId(requestContext);
+ HashMap<String, String> instanceIdMap = new HashMap<>();
+ instanceIdMap.put("serviceInstanceId", serviceInstanceId);
+ instanceIdMap.put("vnfInstanceId", vnfInstanceId);
+ return serviceInstances(request, Action.scaleOut, instanceIdMap, version, requestId, getRequestUri(requestContext));
+ }
@POST
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 a9cf35796b..a14554c8a1 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
@@ -20,9 +20,25 @@
package org.onap.so.apihandlerinfra.tenantisolation;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.transaction.Transactional;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
import org.apache.http.HttpStatus;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.ResponseBuilder;
@@ -33,8 +49,12 @@ import org.onap.so.apihandlerinfra.exceptions.ApiException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.apihandlerinfra.logging.AlarmLoggerInfo;
import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo;
-import org.onap.so.apihandlerinfra.tenantisolationbeans.*;
+import org.onap.so.apihandlerinfra.tenantisolationbeans.CloudOrchestrationRequestList;
+import org.onap.so.apihandlerinfra.tenantisolationbeans.CloudOrchestrationResponse;
+import org.onap.so.apihandlerinfra.tenantisolationbeans.InstanceReferences;
import org.onap.so.apihandlerinfra.tenantisolationbeans.Request;
+import org.onap.so.apihandlerinfra.tenantisolationbeans.RequestDetails;
+import org.onap.so.apihandlerinfra.tenantisolationbeans.RequestStatus;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.exceptions.ValidationException;
import org.onap.so.logger.MessageEnum;
@@ -44,15 +64,10 @@ import org.onap.so.utils.UUIDChecker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import javax.transaction.Transactional;
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
+import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
@Component
@Path("onap/so/infra/cloudResourcesRequests")
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java
index 4c7365b187..f366c7e74b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java
@@ -53,7 +53,7 @@ public class CloudConfigurationValidation implements ValidationRule{
(action == Action.enablePort || action == Action.disablePort || action == Action.activateInstance || action == Action.deactivateInstance)){
throw new ValidationException ("cloudConfiguration");
}
- if(requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && action == Action.deactivateAndCloudDelete){
+ if(requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && (action == Action.deactivateAndCloudDelete || action == Action.scaleOut)){
throw new ValidationException("cloudConfiguration");
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ConfigurationParametersValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ConfigurationParametersValidation.java
new file mode 100644
index 0000000000..edd1b1a10e
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ConfigurationParametersValidation.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.apihandlerinfra.validation;
+
+import java.util.List;
+import java.util.Map;
+
+import org.onap.so.apihandlerinfra.Action;
+import org.onap.so.apihandlerinfra.Actions;
+import org.onap.so.exceptions.ValidationException;
+import org.onap.so.serviceinstancebeans.ModelType;
+import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
+
+public class ConfigurationParametersValidation implements ValidationRule{
+ private static boolean empty(String s) {
+ return (s == null || s.trim().isEmpty());
+ }
+ @Override
+ public ValidationInformation validate(ValidationInformation info) throws ValidationException{
+ ServiceInstancesRequest sir = info.getSir();
+ List<Map<String, String>> configParams = sir.getRequestDetails().getConfigurationParameters();
+ String requestScope = info.getRequestScope();
+ Actions action = info.getAction();
+
+ if(requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && action == Action.scaleOut && configParams.isEmpty()){
+ throw new ValidationException("configuration parameters");
+ }
+ return info;
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java
index 8ab7fccdff..aa98d2abf2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java
@@ -23,6 +23,7 @@ package org.onap.so.apihandlerinfra.validation;
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.Actions;
+import org.onap.so.apihandlerinfra.TestApi;
import org.onap.so.exceptions.ValidationException;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.ModelType;
@@ -73,19 +74,22 @@ public class ModelInfoValidation implements ValidationRule{
(requestScope.equalsIgnoreCase(ModelType.configuration.name()) && (action == Action.activateInstance || action == Action.deactivateInstance))))) {
throw new ValidationException ("modelInvariantId");
}
+ if(empty(modelInfo.getModelInvariantId()) && (requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && action == Action.scaleOut)){
+ throw new ValidationException("modelInvariantId");
+ }
if (!empty (modelInfo.getModelInvariantId ()) && !UUIDChecker.isValidUUID (modelInfo.getModelInvariantId ())) {
throw new ValidationException ("modelInvariantId format");
}
if(reqVersion >= 4 && !(requestScope.equalsIgnoreCase(ModelType.configuration.name())) && empty (modelInfo.getModelName ()) && (action == Action.createInstance || action == Action.updateInstance ||
- action == Action.addRelationships || action == Action.removeRelationships || (action == Action.deleteInstance && (requestScope.equalsIgnoreCase (ModelType.vfModule.name ()))))){
+ action == Action.addRelationships || action == Action.removeRelationships || ((action == Action.deleteInstance || action == Action.scaleOut) && (requestScope.equalsIgnoreCase (ModelType.vfModule.name ()))))){
throw new ValidationException ("modelName");
}
if (empty (modelInfo.getModelVersion ()) && !(requestScope.equalsIgnoreCase(ModelType.configuration.name())) &&
(!(reqVersion < 4 && requestScope.equalsIgnoreCase (ModelType.network.name ()))
- && (action == Action.createInstance || action == Action.updateInstance || action == Action.addRelationships || action == Action.removeRelationships))) {
+ && (action == Action.createInstance || action == Action.updateInstance || action == Action.addRelationships || action == Action.removeRelationships || action == Action.scaleOut))) {
throw new ValidationException ("modelVersion");
}
@@ -95,6 +99,9 @@ public class ModelInfoValidation implements ValidationRule{
(requestScope.equalsIgnoreCase(ModelType.configuration.name()) && (action == Action.activateInstance || action == Action.deactivateInstance))))) {
throw new ValidationException ("modelVersionId");
}
+ if(empty(modelInfo.getModelVersionId()) && (requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && action == Action.scaleOut)){
+ throw new ValidationException("modelVersionId");
+ }
if(requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action != Action.deleteInstance && empty (modelInfo.getModelCustomizationName ())) {
if (!UUIDChecker.isValidUUID (modelInfo.getModelCustomizationId())) {
@@ -106,6 +113,9 @@ public class ModelInfoValidation implements ValidationRule{
&& (action == Action.updateInstance || action == Action.createInstance)){
throw new ValidationException ("modelCustomizationId");
}
+ if(empty(modelInfo.getModelCustomizationId()) && action == Action.scaleOut && !(requestParameters.getTestApi() == TestApi.VNF_API.name() && requestParameters.isUsePreload() == true)){
+ throw new ValidationException ("modelCustomizationId");
+ }
return info;
}
} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java
index 096b30939b..1f4fbc974a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java
@@ -217,7 +217,8 @@ public class RelatedInstancesValidation implements ValidationRule{
}
else if ((( requestScope.equalsIgnoreCase(ModelType.vnf.name ()) || requestScope.equalsIgnoreCase(ModelType.volumeGroup.name ()) || requestScope.equalsIgnoreCase(ModelType.vfModule.name ())
|| requestScope.equalsIgnoreCase(ModelType.configuration.name())) && (action == Action.createInstance || action == Action.enablePort || action == Action.disablePort)) ||
- (reqVersion >= 4 && (requestScope.equalsIgnoreCase(ModelType.volumeGroup.name ()) || requestScope.equalsIgnoreCase(ModelType.vfModule.name ())) && action == Action.updateInstance) ||
+ (reqVersion >= 4 && (requestScope.equalsIgnoreCase(ModelType.volumeGroup.name ()) || requestScope.equalsIgnoreCase(ModelType.vfModule.name ())) && action == Action.updateInstance ||
+ (requestScope.equalsIgnoreCase(ModelType.vfModule.name ()) && action == Action.scaleOut)) ||
(requestScope.equalsIgnoreCase(ModelType.service.name()) && (action.equals(Action.addRelationships) || action.equals(Action.removeRelationships)))){
msoLogger.debug ("related instance exception");
throw new ValidationException ("related instances");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
index 7feea9a456..63dc96f485 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
@@ -192,6 +192,7 @@ public class MsoRequestTest extends BaseTest {
{"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/CloudConfigurationConfig.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.enablePort, 5},
{"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/InPlaceSoftwareUpdateCloudConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.inPlaceSoftwareUpdate, 6},
{"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/DeactivateAndCloudDeleteCloudConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deactivateAndCloudDelete, 7},
+ {"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/ScaleOutNoCloudConfig.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid lcpCloudRegionId is specified", mapper.readValue(inputStream("/CloudConfiguration/EmptyLcpCloudConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid lcpCloudRegionId is specified", mapper.readValue(inputStream("/CloudConfiguration/InPlaceSoftwareUpdateCloudRegionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.inPlaceSoftwareUpdate, 6},
{"No valid tenantId is specified", mapper.readValue(inputStream("/CloudConfiguration/EmptyTenantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
@@ -206,6 +207,7 @@ public class MsoRequestTest extends BaseTest {
{"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/ModelCustomization.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.replaceInstance, 6},
{"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/ModelCustomization.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 6},
{"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/VnfModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.replaceInstance, 5},
+ {"No valid modelCustomizationId is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid model-info is specified", mapper.readValue(inputStream("/ModelInfo/ModelInfoNull.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid modelInvariantId format is specified", mapper.readValue(inputStream("/ModelInfo/InvalidModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 2},
{"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/ModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deactivateInstance, 4},
@@ -215,11 +217,14 @@ public class MsoRequestTest extends BaseTest {
{"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/ModelInvariantIdConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 3},
{"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/v5DeactivateModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deactivateInstance, 5},
{"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/v3UpdateNetworkBad.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 4},
+ {"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid modelName is specified", mapper.readValue(inputStream("/ModelInfo/VfModuleModelName.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deleteInstance, 4},
+ {"No valid modelName is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelName.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid modelType is specified", mapper.readValue(inputStream("/ModelInfo/ModelTypeNull.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionService.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 3},
{"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionVfModule.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 3},
{"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionServiceCreate.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 3},
+ {"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelVersion.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ConfigurationModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5},
{"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/v2ModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 4},
@@ -229,6 +234,7 @@ public class MsoRequestTest extends BaseTest {
{"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/v2ModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.disablePort, 5},
{"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionIdCreate.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/v5ActivateModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5},
+ {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
//ValidationException for Platform and LineOfBusiness
{"No valid lineOfBusinessName is specified", mapper.readValue(inputStream("/PlatformAndLineOfBusiness/EmptyLineOfBusiness.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid platform is specified", mapper.readValue(inputStream("/PlatformAndLineOfBusiness/Platform.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 6},
@@ -261,6 +267,7 @@ public class MsoRequestTest extends BaseTest {
{"No valid related instances is specified", mapper.readValue(inputStream("/RelatedInstances/v5EnablePortNoRelatedInstance.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.enablePort, 5},
{"No valid related instances is specified", mapper.readValue(inputStream("/RelatedInstances/v5CreateNoRelatedInstances.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid related instances is specified", mapper.readValue(inputStream("/RelatedInstances/v4RelatedInstancesNull.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 4},
+ {"No valid related instances is specified", mapper.readValue(inputStream("/RelatedInstances/ScaleOutNoRelatedInstances.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid related service instance for vfModule request is specified", mapper.readValue(inputStream("/RelatedInstances/VfModuleRelatedInstancesService.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5},
{"No valid related service instance for vnf request is specified", mapper.readValue(inputStream("/RelatedInstances/VnfRelatedInstancesService.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5},
{"No valid related service instance for volumeGroup request is specified", mapper.readValue(inputStream("/RelatedInstances/RelatedInstancesServiceInstance.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5},
@@ -275,6 +282,7 @@ public class MsoRequestTest extends BaseTest {
{"No valid requestInfo is specified", mapper.readValue(inputStream("/RequestInfo/RequestInfoNull.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5},
{"No valid requestInfo is specified", mapper.readValue(inputStream("/RequestInfo/RequestInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.applyUpdatedConfig, 6},
{"No valid requestInfo is specified", mapper.readValue(inputStream("/RequestInfo/RequestInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.inPlaceSoftwareUpdate, 6},
+ {"No valid requestInfo is specified", mapper.readValue(inputStream("/RequestInfo/ScaleOutNoRequestInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7},
{"No valid productFamilyId is specified", mapper.readValue(inputStream("/RequestInfo/VnfProductFamilyId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 3},
{"No valid productFamilyId is specified", mapper.readValue(inputStream("/RequestInfo/NetworkProductFamilyId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 3},
{"No valid productFamilyId is specified", mapper.readValue(inputStream("/RequestInfo/NetworkProductFamilyId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 3},
@@ -310,7 +318,9 @@ public class MsoRequestTest extends BaseTest {
{"No valid model-info in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/Network.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7},
{"No valid modelCustomizationId in userParams vfModule resources is specified", mapper.readValue(inputStream("/RequestParameters/VfModuleModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7},
{"No valid modelCustomizationId in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/VnfModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7},
- {"No valid modelCustomizationId in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/NetworkModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}
+ {"No valid modelCustomizationId in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/NetworkModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7},
+ //Validation for ConfigurationParameters
+ {"No valid configuration parameters is specified", mapper.readValue(inputStream("/ConfigurationParameters/NoConfigurationParameters.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}
});
}
@Test
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index ef318513fc..48d424c8d1 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -1433,4 +1433,26 @@ public class ServiceInstancesTest extends BaseTest{
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(request));
assertThat(request, sameBeanAs(expected));
}
+ @Test
+ public void scaleOutVfModule() throws JsonParseException, JsonMappingException, IOException {
+ stubFor(post(urlPathEqualTo("/mso/async/services/WorkflowActionBB"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBodyFile("Camunda/TestResponse.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+
+ //expected response
+ ServiceInstancesResponse expectedResponse = new ServiceInstancesResponse();
+ RequestReferences requestReferences = new RequestReferences();
+ requestReferences.setInstanceId("1882939");
+ expectedResponse.setRequestReferences(requestReferences);
+ uri = servInstanceuri + "v7" + "/serviceInstances/7a88cbeb-0ec8-4765-a271-4f9e90c3da7b/vnfs/cbba721b-4803-4df7-9347-307c9a955426/vfModules/scaleOut";
+ ResponseEntity<String> response = sendRequest(inputStream("/ScaleOutRequest.json"), uri, HttpMethod.POST);
+
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
+ ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
+ assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
+ assertTrue(response.getBody().contains("1882939"));
+ }
} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/ScaleOutNoCloudConfig.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/ScaleOutNoCloudConfig.json
new file mode 100644
index 0000000000..1cc91500f0
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/ScaleOutNoCloudConfig.json
@@ -0,0 +1,50 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::base::module-0",
+ "modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671",
+ "modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelVersion": "2",
+ "modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ConfigurationParameters/NoConfigurationParameters.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ConfigurationParameters/NoConfigurationParameters.json
new file mode 100644
index 0000000000..2f3f42e135
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ConfigurationParameters/NoConfigurationParameters.json
@@ -0,0 +1,54 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::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": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "ff305d54-75b4-431b-adb2-eb6b9e5ff000",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "ff305d54-75b4-431b-adb2-eb6b9e5ff000",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelCustomizationId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelCustomizationId.json
new file mode 100644
index 0000000000..d1220ad949
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelCustomizationId.json
@@ -0,0 +1,53 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::base::module-0",
+ "modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671",
+ "modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelVersion": "2"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelInvariantId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelInvariantId.json
new file mode 100644
index 0000000000..9447250ef6
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelInvariantId.json
@@ -0,0 +1,53 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::base::module-0",
+ "modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671",
+ "modelVersion": "2",
+ "modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelName.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelName.json
new file mode 100644
index 0000000000..ca60ffcf41
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelName.json
@@ -0,0 +1,53 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671",
+ "modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelVersion": "2",
+ "modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersion.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersion.json
new file mode 100644
index 0000000000..b9914d374b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersion.json
@@ -0,0 +1,53 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::base::module-0",
+ "modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671",
+ "modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionId.json
new file mode 100644
index 0000000000..b4afcda4cf
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionId.json
@@ -0,0 +1,53 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::base::module-0",
+ "modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelVersion": "2",
+ "modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionVersion.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionVersion.json
new file mode 100644
index 0000000000..b9914d374b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/ScaleOutNoModelVersionVersion.json
@@ -0,0 +1,53 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::base::module-0",
+ "modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671",
+ "modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "MSO-DEV-VF-1806BB-vSAMP10a-base-it2-1",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "xxxxxx"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RelatedInstances/ScaleOutNoRelatedInstances.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RelatedInstances/ScaleOutNoRelatedInstances.json
new file mode 100644
index 0000000000..47f49a728a
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RelatedInstances/ScaleOutNoRelatedInstances.json
@@ -0,0 +1,34 @@
+{
+ "requestDetails":{
+ "modelInfo":{
+ "modelType":"vfModule",
+ "modelInvariantId":"ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelVersionId":"fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelCustomizationId":"cb82ffd8-252a-11e7-93ae-92361f002672",
+ "modelName":"vSAMP12..base..module-0",
+ "modelVersion":"1"
+ },
+ "cloudConfiguration":{
+ "lcpCloudRegionId":"mdt1",
+ "tenantId":"88a6ca3ee0394ade9403f075db23167e"
+ },
+ "requestInfo":{
+ "instanceName":"MSOTEST103a-vSAMP12_base_module-0",
+ "source":"VID",
+ "suppressRollback":true,
+ "requestorId":"xxxxxx"
+ },
+ "requestParameters":{
+ "usePreload":true,
+ "userParams":[
+
+ ]
+ },
+ "configurationParameters":[
+ {
+ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]",
+ "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestInfo/ScaleOutNoRequestInfo.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestInfo/ScaleOutNoRequestInfo.json
new file mode 100644
index 0000000000..d403cc2af9
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestInfo/ScaleOutNoRequestInfo.json
@@ -0,0 +1,48 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "vSAMP10aDEV::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": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "MSOTADevInfra_vSAMP10a_Service",
+ "modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671",
+ "modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "vSAMP10a",
+ "modelVersionId": "d40be095-940e-4738-a72a-59aa9eb5671e",
+ "modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671",
+ "modelCustomizationName": "vSAMP10a 1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "usePreload": true,
+ "userParams": []
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ScaleOutRequest.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ScaleOutRequest.json
new file mode 100644
index 0000000000..ba5a8a92e5
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ScaleOutRequest.json
@@ -0,0 +1,71 @@
+{
+ "requestDetails":{
+ "modelInfo":{
+ "modelType":"vfModule",
+ "modelInvariantId":"ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelVersionId":"fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelCustomizationId":"cb82ffd8-252a-11e7-93ae-92361f002672",
+ "modelName":"vSAMP12..base..module-0",
+ "modelVersion":"1"
+ },
+ "cloudConfiguration":{
+ "lcpCloudRegionId":"mdt1",
+ "tenantId":"88a6ca3ee0394ade9403f075db23167e"
+ },
+ "requestInfo":{
+ "instanceName":"MSOTEST103a-vSAMP12_base_module-0",
+ "source":"VID",
+ "suppressRollback":true,
+ "requestorId":"xxxxxx"
+ },
+ "relatedInstanceList":[
+ {
+ "relatedInstance":{
+ "instanceId":"cbba721b-4803-4df7-9347-307c9a955426",
+ "instanceName":"MSOTESTVOL103a-vSAMP12_base_module-0_vol",
+ "modelInfo":{
+ "modelType":"volumeGroup"
+ }
+ }
+ },
+ {
+ "relatedInstance":{
+ "instanceId":"7a88cbeb-0ec8-4765-a271-4f9e90c3da7b",
+ "modelInfo":{
+ "modelType":"service",
+ "modelInvariantId":"ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelVersionId":"fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelName":"{parent service model name}",
+ "modelVersion":"1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance":{
+ "instanceId":"cbba721b-4803-4df7-9347-307c9a955426",
+ "modelInfo":{
+ "modelType":"vnf",
+ "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelVersionId":"fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelName":"vSAMP12",
+ "modelVersion":"1.0",
+ "modelCustomizationName":"vSAMP12 1",
+ "modelCustomizationId":"a7f1d08e-b02d-11e6-80f5-76304dec7eb7"
+ }
+ }
+ }
+ ],
+ "requestParameters":{
+ "usePreload":true,
+ "userParams":[
+
+ ]
+ },
+ "configurationParameters":[
+ {
+ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]",
+ "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]"
+ }
+ ]
+ }
+} \ No newline at end of file
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 54984eeabb..70c0791055 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
@@ -224,8 +224,7 @@ INSERT INTO vnf_components_recipe(ID, VNF_TYPE, VNF_COMPONENT_TYPE, ACTION, SERV
('19', 'vfModule', 'vfModule', 'createInstance', '', '1', 'VID_DEFAULT recipe to create vf-module if no custom BPMN flow is found', '/mso/async/services/CreateVfModuleInfra', '', '180', '2016-09-14 19:18:20', '20c4431c-246d-11e7-93ae-92361f002672'),
('20', 'vfModule', 'vfModule', 'deleteInstance', '', '1', 'VID_DEFAULT recipe to delete vf-module if no custom BPMN flow is found', '/mso/async/services/DeleteVfModuleInfra', '', '180', '2016-09-14 19:18:20', 'VID_DEFAULT'),
('21', 'vfModule', 'vfModule', 'updateInstance', '', '1', 'VID_DEFAULT recipe to update vf-module if no custom BPMN flow is found', '/mso/async/services/UpdateVfModuleInfra', '', '180', '2016-09-14 19:18:20', 'VID_DEFAULT'),
-('25', 'vfModule', 'vfModule', 'replaceInstance', '', '1', 'VID_DEFAULT vfModule replace', '/mso/async/services/ReplaceVfModuleInfra', '', '180', '2017-07-28 18:25:06', 'VID_DEFAULT');
-
+('25', 'vfModule', 'vfModule', 'replaceInstance', '', '1', 'VID_DEFAULT vfModule replace', '/mso/async/services/ReplaceVfModuleInfra', '', '180', '2017-07-28 18:25:06', 'VID_DEFAULT');
INSERT INTO catalogdb.network_recipe(ID, MODEL_NAME, ACTION, DESCRIPTION, ORCHESTRATION_URI, NETWORK_PARAM_XSD, RECIPE_TIMEOUT, SERVICE_TYPE, CREATION_TIMESTAMP, VERSION_STR) VALUES
('17', 'VID_DEFAULT', 'createInstance', 'VID_DEFAULT recipe to create network if no custom BPMN flow is found', '/mso/async/services/CreateNetworkInstance', '', '180', '', '2016-09-14 19:18:20', '1.0'),
@@ -274,7 +273,9 @@ VALUES
('vfModule', 'deleteInstance', '1', 'Gr api recipe to delete vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'),
('vfModule', 'updateInstance', '1', 'Gr api recipe to update vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'),
('vfModule', 'replaceInstance', '1', 'Gr api recipe to replace vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'),
-('vfModule', 'deactivateAndCloudDelete', '1', 'Gr api recipe to deactivateAndCloudDelete vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT');
+('vfModule', 'deactivateAndCloudDelete', '1', 'Gr api recipe to deactivateAndCloudDelete vf-module', '/mso/async/services/WorkflowActionBB', 180, 'GR-API-DEFAULT'),
+('vfModule', 'scaleOut', '1', 'Gr api recipe to scale out vfModule', '/mso/async/services/WorkflowActionBB', '180', 'GR-API-DEFAULT');
+
UPDATE vnf_components_recipe
SET vf_module_model_uuid = 'VNF-API-DEFAULT'
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
index e6d02c6836..b1c81cf8d8 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
@@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.openpojo.business.annotation.BusinessKey;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
index 53c97fbce6..9cce212c36 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
@@ -51,211 +51,213 @@ import javax.persistence.TemporalType;
@Entity
@Table(name = "cloud_sites")
public class CloudSite {
-
- @JsonProperty
- @BusinessKey
- @Id
- @Column(name = "ID")
- private String id;
-
- @JsonProperty("region_id")
- @BusinessKey
- @Column(name = "REGION_ID")
- private String regionId;
-
- @JsonProperty("aic_version")
- @BusinessKey
- @Column(name = "CLOUD_VERSION")
- private String cloudVersion;
-
- @JsonProperty("clli")
- @BusinessKey
- @Column(name = "CLLI")
- private String clli;
-
- @JsonProperty("platform")
- @BusinessKey
- @Column(name = "PLATFORM")
- private String platform;
-
- @JsonProperty("orchestrator")
- @BusinessKey
- @Column(name = "ORCHESTRATOR")
- private String orchestrator;
-
- @JsonProperty("cloudify_id")
- @BusinessKey
- @Column(name = "CLOUDIFY_ID")
- private String cloudifyId;
-
- // Derived property (set by CloudConfig loader based on identityServiceId)
- @BusinessKey
- @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- @JoinColumn(name = "IDENTITY_SERVICE_ID")
- private CloudIdentity identityService;
-
- @BusinessKey
- @JsonProperty("identity_service_id")
- transient private String identityServiceId;
-
- @JsonProperty("last_updated_by")
- @BusinessKey
- @Column(name = "LAST_UPDATED_BY")
- private String lastUpdatedBy ;
-
- @JsonProperty("creation_timestamp")
- @BusinessKey
- @Column(name = "CREATION_TIMESTAMP", updatable = false)
- @Temporal(TemporalType.TIMESTAMP)
- private Date created;
-
- @JsonProperty("update_timestamp")
- @BusinessKey
- @Column(name = "UPDATE_TIMESTAMP")
- @Temporal(TemporalType.TIMESTAMP)
- private Date updated;
-
- public CloudSite() {
-
- }
-
- @PrePersist
- protected void onCreate() {
- this.created = new Date();
- this.updated = new Date();
- }
-
- public CloudSite(CloudSite site) {
- this.cloudVersion = site.getCloudVersion();
- this.clli = site.getClli();
- this.id = site.getId();
- this.identityService = site.getIdentityService();
- this.orchestrator = site.getOrchestrator();
- this.platform = site.getPlatform();
- this.regionId = site.getRegionId();
- this.identityServiceId = site.getIdentityServiceId();
- }
- public String getId() {
- return this.id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getRegionId() {
- return regionId;
- }
-
- public void setRegionId(String regionId) {
- this.regionId = regionId;
- }
-
- public String getIdentityServiceId() {
- return identityServiceId == null ? (identityService== null? null:identityService.getId()):identityServiceId;
- }
-
- public String getCloudVersion() {
- return cloudVersion;
- }
-
- public void setCloudVersion(String cloudVersion) {
- this.cloudVersion = cloudVersion;
- }
-
- public String getClli() {
- return clli;
- }
-
- public void setClli(String clli) {
- this.clli = clli;
- }
-
- public String getCloudifyId() {
- return cloudifyId;
- }
-
- public void setCloudifyId(String cloudifyId) {
- this.cloudifyId = cloudifyId;
- }
-
- public String getLastUpdatedBy() {
- return lastUpdatedBy;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public Date getUpdated() {
- return updated;
- }
-
- public void setLastUpdatedBy(String lastUpdatedBy) {
- this.lastUpdatedBy = lastUpdatedBy;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- public void setUpdated(Date updated) {
- this.updated = updated;
- }
-
- public String getPlatform() {
- return platform;
- }
-
- public void setPlatform(String platform) {
- this.platform = platform;
- }
-
- public String getOrchestrator() {
- return orchestrator;
- }
-
- public void setOrchestrator(String orchestrator) {
- this.orchestrator = orchestrator;
- }
-
- public CloudIdentity getIdentityService () {
- return identityService;
- }
-
- public void setIdentityService (CloudIdentity identity) {
- this.identityService = identity;
- }
- @Deprecated
- public void setIdentityServiceId(String identityServiceId) {
- this.identityServiceId = identityServiceId;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("regionId", getRegionId())
- .append("identityServiceId", getIdentityServiceId()).append("cloudVersion", getCloudVersion())
- .append("clli", getClli()).append("cloudifyId", getCloudifyId()).append("platform", getPlatform())
- .append("orchestrator", getOrchestrator()).toString();
- }
-
- @Override
- public boolean equals(final Object other) {
- if (other == null) {
- return false;
- }
- if (!getClass().equals(other.getClass())) {
- return false;
- }
- CloudSite castOther = (CloudSite) other;
- return new EqualsBuilder().append(getRegionId(), castOther.getRegionId())
- .append(getIdentityServiceId(), castOther.getIdentityServiceId())
- .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()).isEquals();
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder(1, 31).append(getRegionId()).append(getIdentityServiceId()).append(getCloudVersion())
- .append(getClli()).toHashCode();
- }
+
+ @JsonProperty
+ @BusinessKey
+ @Id
+ @Column(name = "ID")
+ private String id;
+
+ @JsonProperty("region_id")
+ @BusinessKey
+ @Column(name = "REGION_ID")
+ private String regionId;
+
+ @JsonProperty("aic_version")
+ @BusinessKey
+ @Column(name = "CLOUD_VERSION")
+ private String cloudVersion;
+
+ @JsonProperty("clli")
+ @BusinessKey
+ @Column(name = "CLLI")
+ private String clli;
+
+ @JsonProperty("platform")
+ @BusinessKey
+ @Column(name = "PLATFORM")
+ private String platform;
+
+ @JsonProperty("orchestrator")
+ @BusinessKey
+ @Column(name = "ORCHESTRATOR")
+ private String orchestrator;
+
+ @JsonProperty("cloudify_id")
+ @BusinessKey
+ @Column(name = "CLOUDIFY_ID")
+ private String cloudifyId;
+
+ // Derived property (set by CloudConfig loader based on identityServiceId)
+ @BusinessKey
+ @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "IDENTITY_SERVICE_ID")
+ private CloudIdentity identityService;
+
+ @BusinessKey
+ @JsonProperty("identity_service_id")
+ private transient String identityServiceId;
+
+ @JsonProperty("last_updated_by")
+ @BusinessKey
+ @Column(name = "LAST_UPDATED_BY")
+ private String lastUpdatedBy ;
+
+ @JsonProperty("creation_timestamp")
+ @BusinessKey
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @JsonProperty("update_timestamp")
+ @BusinessKey
+ @Column(name = "UPDATE_TIMESTAMP")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date updated;
+
+ public CloudSite() {
+
+ }
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ this.updated = new Date();
+ }
+
+ public CloudSite(CloudSite site) {
+ this.cloudVersion = site.getCloudVersion();
+ this.clli = site.getClli();
+ this.id = site.getId();
+ this.identityService = site.getIdentityService();
+ this.orchestrator = site.getOrchestrator();
+ this.platform = site.getPlatform();
+ this.regionId = site.getRegionId();
+ this.identityServiceId = site.getIdentityServiceId();
+ }
+
+
+ public String getId() {
+ return this.id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRegionId() {
+ return regionId;
+ }
+
+ public void setRegionId(String regionId) {
+ this.regionId = regionId;
+ }
+
+ public String getIdentityServiceId() {
+ return identityServiceId == null ? (identityService== null? null:identityService.getId()):identityServiceId;
+ }
+
+ public String getCloudVersion() {
+ return cloudVersion;
+ }
+
+ public void setCloudVersion(String cloudVersion) {
+ this.cloudVersion = cloudVersion;
+ }
+
+ public String getClli() {
+ return clli;
+ }
+
+ public void setClli(String clli) {
+ this.clli = clli;
+ }
+
+ public String getCloudifyId() {
+ return cloudifyId;
+ }
+
+ public void setCloudifyId(String cloudifyId) {
+ this.cloudifyId = cloudifyId;
+ }
+
+ public String getLastUpdatedBy() {
+ return lastUpdatedBy;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public Date getUpdated() {
+ return updated;
+ }
+
+ public void setLastUpdatedBy(String lastUpdatedBy) {
+ this.lastUpdatedBy = lastUpdatedBy;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public void setUpdated(Date updated) {
+ this.updated = updated;
+ }
+
+ public String getPlatform() {
+ return platform;
+ }
+
+ public void setPlatform(String platform) {
+ this.platform = platform;
+ }
+
+ public String getOrchestrator() {
+ return orchestrator;
+ }
+
+ public void setOrchestrator(String orchestrator) {
+ this.orchestrator = orchestrator;
+ }
+
+ public CloudIdentity getIdentityService () {
+ return identityService;
+ }
+
+ public void setIdentityService (CloudIdentity identity) {
+ this.identityService = identity;
+ }
+ @Deprecated
+ public void setIdentityServiceId(String identityServiceId) {
+ this.identityServiceId = identityServiceId;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("regionId", getRegionId())
+ .append("identityServiceId", getIdentityServiceId()).append("cloudVersion", getCloudVersion())
+ .append("clli", getClli()).append("cloudifyId", getCloudifyId()).append("platform", getPlatform())
+ .append("orchestrator", getOrchestrator()).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (other == null) {
+ return false;
+ }
+ if (!getClass().equals(other.getClass())) {
+ return false;
+ }
+ CloudSite castOther = (CloudSite) other;
+ return new EqualsBuilder().append(getRegionId(), castOther.getRegionId())
+ .append(getIdentityServiceId(), castOther.getIdentityServiceId())
+ .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder(1, 31).append(getRegionId()).append(getIdentityServiceId()).append(getCloudVersion())
+ .append(getClli()).toHashCode();
+ }
} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepository.java
deleted file mode 100644
index c1714821ee..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepository.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.onap.so.db.catalog.data.repository;
-
-import org.onap.so.db.catalog.beans.CloudIdentity;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.rest.core.annotation.RepositoryRestResource;
-
-@RepositoryRestResource(collectionResourceRel = "cloudIdentity", path = "cloudIdentity")
-public interface CloudIdentityRepository extends JpaRepository<CloudIdentity, String> {
-
-}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepositoryTest.java
deleted file mode 100644
index 8fb65c2080..0000000000
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudIdentityRepositoryTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.onap.so.db.catalog.data.repository;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.onap.so.BaseTest;
-import org.onap.so.db.catalog.beans.CloudIdentity;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class CloudIdentityRepositoryTest extends BaseTest {
-
- @Autowired
- private CloudIdentityRepository cloudIdentityRepository;
-
- @Test
- public void findOneTest() throws Exception {
- CloudIdentity cloudIdentity = cloudIdentityRepository.findOne("mtn13");
- Assert.assertNotNull(cloudIdentity);
- Assert.assertEquals("mtn13",cloudIdentity.getId());
- }
-
-} \ No newline at end of file
diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml
index 9f96b2fcd0..eed81b9ca9 100644
--- a/packages/docker/pom.xml
+++ b/packages/docker/pom.xml
@@ -72,7 +72,7 @@
<images>
<image>
- <name>so/base-image:1.0</name>
+ <name>onap/so/base-image:1.0</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -80,7 +80,7 @@
</build>
</image>
<image>
- <name>so/catalog-db-adapter</name>
+ <name>onap/so/catalog-db-adapter</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -105,7 +105,7 @@
</build>
</image>
<image>
- <name>so/request-db-adapter</name>
+ <name>onap/so/request-db-adapter</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -130,7 +130,7 @@
</build>
</image>
<image>
- <name>so/sdnc-adapter</name>
+ <name>onap/so/sdnc-adapter</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -155,7 +155,7 @@
</build>
</image>
<image>
- <name>so/openstack-adapter</name>
+ <name>onap/so/openstack-adapter</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -180,7 +180,7 @@
</build>
</image>
<image>
- <name>so/vfc-adapter</name>
+ <name>onap/so/vfc-adapter</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -205,7 +205,7 @@
</build>
</image>
<image>
- <name>so/asdc-controller</name>
+ <name>onap/so/asdc-controller</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -230,7 +230,7 @@
</build>
</image>
<image>
- <name>so/bpmn-infra</name>
+ <name>onap/so/bpmn-infra</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -255,7 +255,7 @@
</build>
</image>
<image>
- <name>so/api-handler-infra</name>
+ <name>onap/so/api-handler-infra</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -310,7 +310,7 @@
<goal>push</goal>
</goals>
<configuration>
- <image>so/catalog-db-adapter,so/request-db-adapter,so/sdnc-adapter,so/openstack-adapter,so/vfc-adapter,so/asdc-controller,so/bpmn-infra,so/api-handler-infra</image>
+ <image>onap/so/catalog-db-adapter,onap/so/request-db-adapter,onap/so/sdnc-adapter,onap/so/openstack-adapter,onap/so/vfc-adapter,onap/so/asdc-controller,onap/so/bpmn-infra,onap/so/api-handler-infra</image>
</configuration>
</execution>
</executions>
diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-app b/packages/docker/src/main/docker/docker-files/Dockerfile.so-app
index 69b88d8905..88031db0cd 100644
--- a/packages/docker/src/main/docker/docker-files/Dockerfile.so-app
+++ b/packages/docker/src/main/docker/docker-files/Dockerfile.so-app
@@ -1,4 +1,4 @@
-FROM so/base-image:1.0
+FROM onap/so/base-image:1.0
ARG http_proxy
ENV HTTP_PROXY=$http_proxy
diff --git a/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml b/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml
index dbba5da9b0..df6d92163b 100644
--- a/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml
+++ b/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml
@@ -166,6 +166,7 @@
name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level"
level="WARN" />
+ <logger name="db.migration" level="DEBUG" />
<logger name="org.apache.wire" level="DEBUG" />
<logger name="org.onap" level="DEBUG" />
<logger name="com.att.ecomp" level="DEBUG" />
@@ -185,4 +186,4 @@
<appender-ref ref="asyncError" />
</root>
-</configuration> \ No newline at end of file
+</configuration>