aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java107
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java54
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java75
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java (renamed from adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java)41
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java87
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java32
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java10
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java5
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java14
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml21
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json1897
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml13
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java41
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java22
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java20
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java159
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java107
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java255
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Platform.java8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java35
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java36
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy110
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy2305
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json903
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml1
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java36
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIObjectType.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java52
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java2
41 files changed, 4651 insertions, 1881 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
index f39962b2ce..1fabcb279c 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
@@ -71,6 +71,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
public static final String VNF_ID = "vnf_id";
public static final String VF_MODULE_ID = "vf_module_id";
public static final String TEMPLATE_TYPE = "template_type";
+ public static final String MULTICLOUD_QUERY_BODY_NULL = "multicloudQueryBody is null";
public static final List<String> MULTICLOUD_INPUTS =
Arrays.asList(OOF_DIRECTIVES, SDNC_DIRECTIVES, USER_DIRECTIVES, TEMPLATE_TYPE);
@@ -228,7 +229,13 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
if (logger.isDebugEnabled()) {
logger.debug("Multicloud Create Response Body: {}", multicloudResponseBody);
}
- return getStackStatus(cloudSiteId, cloudOwner, tenantId, canonicalName, pollForCompletion, timeoutMinutes, backout);
+ StackInfo stackStatus = getStackStatus(cloudSiteId, cloudOwner, tenantId, canonicalName, pollForCompletion, timeoutMinutes, backout);
+
+ if (HeatStatus.CREATED.equals(stackStatus.getStatus())) {
+ multicloudAaiUpdate(cloudSiteId, cloudOwner, tenantId, genericVnfId, vfModuleId, multicloudResponseBody.getWorkloadId(), pollForCompletion, timeoutMinutes);
+ }
+
+ return stackStatus;
}
StringBuilder stackErrorStatusReason = new StringBuilder(response.getStatusInfo().getReasonPhrase());
if (null != multicloudResponseBody) {
@@ -287,7 +294,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
if (multicloudClient != null) {
Response response = multicloudClient.get();
if (logger.isDebugEnabled()) {
- logger.debug (String.format("Mulicloud GET Response: %s", response.toString()));
+ logger.debug (String.format("Multicloud GET Response: %s", response.toString()));
}
MulticloudQueryResponse multicloudQueryBody = null;
@@ -296,11 +303,16 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
returnInfo.setStatusMessage(response.getStatusInfo().getReasonPhrase());
} else if (response.getStatus() == Response.Status.OK.getStatusCode() && response.hasEntity()) {
multicloudQueryBody = getQueryBody((java.io.InputStream)response.getEntity());
- returnInfo.setCanonicalName(stackName + "/" + multicloudQueryBody.getWorkloadId());
- returnInfo.setStatus(getHeatStatus(multicloudQueryBody.getWorkloadStatus()));
- returnInfo.setStatusMessage(multicloudQueryBody.getWorkloadStatus());
- if (logger.isDebugEnabled()) {
- logger.debug("Multicloud Create Response Body: " + multicloudQueryBody.toString());
+ if (multicloudQueryBody != null) {
+ returnInfo.setCanonicalName(stackName + "/" + multicloudQueryBody.getWorkloadId());
+ returnInfo.setStatus(getHeatStatus(multicloudQueryBody.getWorkloadStatus()));
+ returnInfo.setStatusMessage(multicloudQueryBody.getWorkloadStatus());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Multicloud Create Response Body: " + multicloudQueryBody.toString());
+ }
+ } else {
+ returnInfo.setStatus(HeatStatus.FAILED);
+ returnInfo.setStatusMessage(MULTICLOUD_QUERY_BODY_NULL);
}
} else {
returnInfo.setStatus(HeatStatus.FAILED);
@@ -371,6 +383,81 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
return HeatStatus.UNKNOWN;
}
+ private void multicloudAaiUpdate(String cloudSiteId, String cloudOwner, String tenantId, String genericVnfId, String vfModuleId, String workloadId,
+ boolean pollForCompletion, int timeoutMinutes) {
+
+ MulticloudRequest multicloudRequest= new MulticloudRequest();
+
+ multicloudRequest.setGenericVnfId(genericVnfId);
+ multicloudRequest.setVfModuleId(vfModuleId);
+
+ String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, cloudOwner, workloadId);
+ RestClient multicloudClient = getMulticloudClient(multicloudEndpoint);
+
+ if (multicloudClient == null) {
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud client could not be initialized");
+ }
+
+ Response response = multicloudClient.post(multicloudRequest);
+ if (response.getStatus() != Response.Status.ACCEPTED.getStatusCode()) {
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud AAI update request failed: " + response.getStatus() + response.getStatusInfo());
+ return;
+ }
+
+ if (!pollForCompletion) {
+ return;
+ }
+
+ int updatePollInterval = Integer.parseInt(this.environment.getProperty(createPollIntervalProp, createPollIntervalDefault));
+ int pollTimeout = (timeoutMinutes * 60) + updatePollInterval;
+ boolean updateTimedOut = false;
+ logger.debug("updatePollInterval=" + updatePollInterval + ", pollTimeout=" + pollTimeout);
+
+ StackInfo stackInfo = null;
+ while (true) {
+ try {
+ stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, workloadId);
+ if (logger.isDebugEnabled())
+ logger.debug (stackInfo.getStatus() + " (" + workloadId + ")");
+
+ if (HeatStatus.UPDATING.equals(stackInfo.getStatus())) {
+ if (pollTimeout <= 0) {
+ // Note that this should not occur, since there is a timeout specified
+ // in the Openstack (multicloud?) call.
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud AAI update timeout failure: {} {} {} {}", cloudOwner, cloudSiteId, tenantId, workloadId);
+ updateTimedOut = true;
+ break;
+ }
+
+ sleep(updatePollInterval * 1000L);
+
+ pollTimeout -= updatePollInterval;
+ if (logger.isDebugEnabled())
+ logger.debug("pollTimeout remaining: " + pollTimeout);
+ } else {
+ break;
+ }
+ } catch (MsoException me) {
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud AAI update exception: {} {} {} {}", cloudOwner, cloudSiteId, tenantId, workloadId, me);
+ return;
+ }
+ }
+ if (updateTimedOut) {
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(), response.getStatusInfo().toString());
+ } else if (!HeatStatus.UPDATED.equals(stackInfo.getStatus())) {
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(), response.getStatusInfo().toString());
+ } else {
+ if (logger.isDebugEnabled())
+ logger.debug("Multicloud AAI update successful: {} {}", response.getStatus(), response.getStatusInfo().toString());
+ }
+ }
+
private StackInfo getStackStatus(String cloudSiteId, String cloudOwner, String tenantId, String instanceId) throws MsoException {
return getStackStatus(cloudSiteId, cloudOwner, tenantId, instanceId, false, 0, false);
}
@@ -543,7 +630,9 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
}
private HeatStatus mapResponseToHeatStatus(Response response) {
- if (response.getStatusInfo().getStatusCode() == Response.Status.OK.getStatusCode()) {
+ if (response == null) {
+ return HeatStatus.FAILED;
+ } else if (response.getStatusInfo().getStatusCode() == Response.Status.OK.getStatusCode()) {
return HeatStatus.CREATED;
} else if (response.getStatusInfo().getStatusCode() == Response.Status.CREATED.getStatusCode()) {
return HeatStatus.CREATED;
@@ -596,7 +685,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
return null;
}
- private String getMulticloudEndpoint(String cloudSiteId, String cloudOwner, String workloadId) throws MsoCloudSiteNotFound {
+ private String getMulticloudEndpoint(String cloudSiteId, String cloudOwner, String workloadId) {
String msbIp = System.getenv().get(ONAP_IP);
if (null == msbIp || msbIp.isEmpty()) {
msbIp = environment.getProperty("mso.msb-ip", DEFAULT_MSB_IP);
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java
index fbe532d1fe..e066c4eec6 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java
@@ -4,8 +4,6 @@
* ================================================================================
* Copyright (C) 2019 Samsung Intellectual Property. All rights reserved.
* ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -23,6 +21,7 @@
package org.onap.so.openstack.utils;
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.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
@@ -30,12 +29,14 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.when;
+import static org.onap.so.openstack.utils.MsoMulticloudUtils.MULTICLOUD_QUERY_BODY_NULL;
import java.io.IOException;
import java.util.HashMap;
import java.util.Optional;
import org.apache.http.HttpStatus;
+import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.InjectMocks;
@@ -67,18 +68,43 @@ public class MsoMulticloudUtilsTest extends BaseTest {
private static final String CREATE_STACK_RESPONSE = "{\"template_type\": \"TEST-template\", \"workload_id\": "
+ "\"TEST-workload\", \"template_response\": {\"stack\": {\"id\": \"TEST-stack\", \"links\": []}}}";
+ private static final String UPDATE_STACK_RESPONSE = "{\"template_type\": \"TEST-template\", \"workload_id\": "
+ + "\"TEST-workload\"}";
+ private static final String GET_CREATE_STACK_RESPONSE = "{\"template_type\": \"TEST-template\", \"workload_id\": "
+ + "\"TEST-workload\", \"workload_status\": \"CREATE_COMPLETE\"}";
+ private static final String GET_UPDATE_STACK_RESPONSE = "{\"template_type\": \"TEST-template\", \"workload_id\": "
+ + "\"TEST-workload\", \"workload_status\": \"UPDATE_COMPLETE\"}";
- private static final String MULTICLOUD_PATH = "/api/multicloud/v1/CloudOwner/MTN14/infra_workload";
+ private static final String MULTICLOUD_CREATE_PATH = "/api/multicloud/v1/CloudOwner/MTN14/infra_workload";
+ private static final String MULTICLOUD_UPDATE_PATH = "/api/multicloud/v1/CloudOwner/MTN14/infra_workload/TEST-workload";
+ private static final String MULTICLOUD_GET_PATH = "/api/multicloud/v1/CloudOwner/MTN14/infra_workload/TEST-workload";
@Test
public void createStackSuccess() throws MsoException, IOException {
- wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_PATH))
+ wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH)).inScenario("CREATE")
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(CREATE_STACK_RESPONSE)
- .withStatus(HttpStatus.SC_CREATED)));
+ .withStatus(HttpStatus.SC_CREATED))
+ .willSetStateTo("CREATING"));
+ wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH))
+ .inScenario("CREATE").whenScenarioStateIs("CREATING")
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody(GET_CREATE_STACK_RESPONSE)
+ .withStatus(HttpStatus.SC_OK)));
+ wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_UPDATE_PATH)).inScenario("CREATE")
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody(UPDATE_STACK_RESPONSE)
+ .withStatus(HttpStatus.SC_ACCEPTED))
+ .willSetStateTo("UPDATING"));
+ wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH))
+ .inScenario("CREATE").whenScenarioStateIs("UPDATING")
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody(GET_UPDATE_STACK_RESPONSE)
+ .withStatus(HttpStatus.SC_OK)));
StackInfo result = multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
- "TEST-heat", new HashMap<>(), false, 200, "TEST-env",
+ "TEST-heat", new HashMap<>(), true, 200, "TEST-env",
new HashMap<>(), new HashMap<>(), false);
+ wireMockServer.resetScenarios();
assertNotNull(result);
assertEquals("TEST-stack", result.getName());
}
@@ -96,6 +122,18 @@ public class MsoMulticloudUtilsTest extends BaseTest {
assertTrue(HeatStatus.NOTFOUND == result.getStatus());
}
+ @Test
+ public void queryStackWithNullMulticloudQueryBody() throws MsoException {
+ wireMockServer.stubFor(get(urlPathEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload/instanceId"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody(CREATE_STACK_RESPONSE)
+ .withStatus(HttpStatus.SC_OK)));
+
+ StackInfo result = multicloudUtils.queryStack("MTN13", "CloudOwner", "TEST-tenant", "instanceId");
+ assertTrue(HeatStatus.FAILED == result.getStatus());
+ assertEquals(MULTICLOUD_QUERY_BODY_NULL, result.getStatusMessage());
+ }
+
@Test(expected = VduException.class)
public void updateVdu() throws MsoException {
multicloudUtils.updateVdu(new CloudInfo(), "instanceId", new HashMap<>(), new VduModelInfo(),
@@ -131,7 +169,7 @@ public class MsoMulticloudUtilsTest extends BaseTest {
@Test
public void createStackBadRequest() {
try {
- wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_PATH))
+ wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withStatus(HttpStatus.SC_BAD_REQUEST)));
multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
@@ -146,7 +184,7 @@ public class MsoMulticloudUtilsTest extends BaseTest {
@Test
public void createStackEmptyResponseEntity() throws MsoException {
- wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_PATH))
+ wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withStatus(HttpStatus.SC_CREATED)));
StackInfo result = multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
new file mode 100644
index 0000000000..710a6ddc13
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
@@ -0,0 +1,75 @@
+package org.onap.so.adapters.audit;
+
+import java.util.Optional;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public abstract class AbstractAuditService {
+
+ private static final Logger logger = LoggerFactory.getLogger(AbstractAuditService.class);
+
+
+
+ protected static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI = "Unable to find all VServers and L-Interaces in A&AI";
+
+ @Autowired
+ public Environment env;
+
+ /**
+ * @param auditHeatStackFailed
+ * @param auditList
+ * @return
+ */
+ protected boolean didCreateAuditFail(Optional<AAIObjectAuditList> auditList) {
+ if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
+ if (logger.isInfoEnabled()) {
+ logger.info("Audit Results: {}", auditList.get().toString());
+ }
+ return auditList.get().getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist())
+ .findFirst().map(v -> true).orElse(false);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @param auditHeatStackFailed
+ * @param auditList
+ * @return
+ */
+ protected boolean didDeleteAuditFail(Optional<AAIObjectAuditList> auditList) {
+ if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
+ if (logger.isInfoEnabled()) {
+ logger.info("Audit Results: {}", auditList.get().toString());
+ }
+ return auditList.get().getAuditList().stream().filter(AAIObjectAudit::isDoesObjectExist)
+ .findFirst().map(v -> true).orElse(false);
+ } else {
+ return false;
+ }
+ }
+
+ protected String[] getRetrySequence() {
+ return env.getProperty("mso.workflow.topics.retrySequence",String[].class);
+ }
+
+ protected void setupMDC(ExternalTask externalTask) {
+ String msoRequestId = externalTask.getVariable("mso-request-id");
+ if(msoRequestId != null && !msoRequestId.isEmpty())
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
+ }
+
+ protected long calculateRetryDelay(int currentRetries){
+ int retrySequence = getRetrySequence().length - currentRetries;
+ long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier","6000"));
+ return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier;
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
index da6bea7dec..5dfba25141 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
@@ -40,11 +40,9 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class AuditStackServiceData {
-
- private static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI = "Unable to find all VServers and L-Interaces in A&AI";
-
- private static final Logger logger = LoggerFactory.getLogger(AuditStackServiceData.class);
+public class AuditCreateStackService extends AbstractAuditService{
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditCreateStackService.class);
@Autowired
public HeatStackAudit heatStackAudit;
@@ -64,7 +62,7 @@ public class AuditStackServiceData {
if (auditListOpt.isPresent()) {
GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
- success = !didAuditFail(auditListOpt);
+ success = !didCreateAuditFail(auditListOpt);
}
} catch (Exception e) {
logger.error("Error during audit of stack", e);
@@ -88,35 +86,8 @@ public class AuditStackServiceData {
logger.debug("The External Task Id: {} Failed", externalTask.getId());
}
}
- private void setupMDC(ExternalTask externalTask) {
- String msoRequestId = externalTask.getVariable("mso-request-id");
- if(msoRequestId != null && !msoRequestId.isEmpty())
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
- }
- protected long calculateRetryDelay(int currentRetries){
- int retrySequence = getRetrySequence().length - currentRetries;
- long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier","6000"));
- return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier;
- }
+
- /**
- * @param auditHeatStackFailed
- * @param auditList
- * @return
- */
- protected boolean didAuditFail(Optional<AAIObjectAuditList> auditList) {
- if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
- if (logger.isInfoEnabled()) {
- logger.info("Audit Results: {}", auditList.get().toString());
- }
- return auditList.get().getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist())
- .findFirst().map(v -> true).orElse(false);
- } else {
- return false;
- }
- }
- public String[] getRetrySequence() {
- return env.getProperty("mso.workflow.topics.retrySequence",String[].class);
- }
+
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
new file mode 100644
index 0000000000..2c2b2f810d
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
@@ -0,0 +1,87 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.audit;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditDeleteStackService extends AbstractAuditService{
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditDeleteStackService.class);
+
+ @Autowired
+ public HeatStackAudit heatStackAudit;
+
+ @Autowired
+ public Environment env;
+
+ protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService){
+ AuditInventory auditInventory = externalTask.getVariable("auditInventory");
+ Map<String, Object> variables = new HashMap<>();
+ setupMDC(externalTask);
+ boolean success = false;
+ try {
+ logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,externalTask.getRetries());
+ Optional<AAIObjectAuditList> auditListOpt=heatStackAudit.auditHeatStack(auditInventory.getCloudRegion(), auditInventory.getCloudOwner(),
+ auditInventory.getTenantId(), auditInventory.getHeatStackName());
+ if (auditListOpt.isPresent()) {
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
+ success = didDeleteAuditFail(auditListOpt);
+ }
+ } catch (Exception e) {
+ logger.error("Error during audit of stack", e);
+ }
+ variables.put("auditIsSuccessful", success);
+ if (success) {
+ externalTaskService.complete(externalTask, variables);
+ logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ } else {
+ if(externalTask.getRetries() == null){
+ logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}", externalTask.getId(),getRetrySequence().length);
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
+ }else if(externalTask.getRetries() != null &&
+ externalTask.getRetries()-1 == 0){
+ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
+ externalTaskService.complete(externalTask);
+ }else{
+ logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ", externalTask.getId(),externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
+ }
+ logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ }
+ }
+
+} \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
index 499c1137c7..1e16c2a016 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
@@ -46,10 +46,13 @@ public class AuditStackService {
public Environment env;
@Autowired
- private AuditStackServiceData auditStack;
+ private AuditCreateStackService auditCreateStack;
+
+ @Autowired
+ private AuditDeleteStackService auditDeleteStack;
@PostConstruct
- public void auditAAIInventory() {
+ public void auditAddAAIInventory() {
String auth = "";
try {
auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
@@ -60,9 +63,26 @@ public class AuditStackService {
auth);
ExternalTaskClient client = ExternalTaskClient.create()
.baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
- .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(10000, 2, 120000)).build();
- client.subscribe("InventoryAudit").lockDuration(60000)
- .handler(auditStack::executeExternalTask).open();
+ .asyncResponseTimeout(120000).build();
+ client.subscribe("InventoryAddAudit").lockDuration(60000)
+ .handler(auditCreateStack::executeExternalTask).open();
}
-
+
+ @PostConstruct
+ public void auditDeleteAAIInventory() {
+ String auth = "";
+ try {
+ auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
+ } catch (IllegalStateException | GeneralSecurityException e) {
+ logger.error("Error Decrypting Password", e);
+ }
+ ClientRequestInterceptor interceptor = new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"),
+ auth);
+ ExternalTaskClient client = ExternalTaskClient.create()
+ .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
+ .asyncResponseTimeout(120000).build();
+ client.subscribe("InventoryDeleteAudit").lockDuration(60000)
+ .handler(auditDeleteStack::executeExternalTask).open();
+ }
+
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
index aafcb1c600..349aa78d44 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
@@ -28,6 +28,7 @@ import javax.jws.WebParam;
import javax.jws.WebParam.Mode;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.ws.Holder;
import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists;
@@ -35,6 +36,7 @@ import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.entity.MsoRequest;
import org.onap.so.openstack.beans.VnfRollback;
import org.onap.so.openstack.beans.VnfStatus;
+import org.onap.so.openstack.mappers.MapAdapter;
@WebService (name="VnfAdapter", targetNamespace="http://org.onap.so/vnf")
public interface MsoVnfAdapter
@@ -51,7 +53,7 @@ public interface MsoVnfAdapter
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="enableBridge") Boolean enableBridge,
@@ -70,7 +72,7 @@ public interface MsoVnfAdapter
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="outputs", mode=Mode.OUT) Holder<Map<String,String>> outputs,
@WebParam(name="rollback", mode=Mode.OUT) Holder<VnfRollback> rollback )
@@ -114,7 +116,7 @@ public interface MsoVnfAdapter
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
@WebParam(name="baseVfHeatStackId") @XmlElement(required=false) String baseVfHeatStackId,
@WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="enableBridge") Boolean enableBridge,
@@ -145,7 +147,7 @@ public interface MsoVnfAdapter
@WebParam(name="baseVfHeatStackId") @XmlElement(required=false) String baseVfHeatStackId,
@WebParam(name="vfModuleStackId") @XmlElement(required=false) String vfModuleStackId,
@WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="outputs", mode=Mode.OUT) Holder<Map<String,String>> outputs,
@WebParam(name="rollback", mode=Mode.OUT) Holder<VnfRollback> rollback )
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java
index 70afb1c69c..5642e01a72 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java
@@ -28,9 +28,11 @@ import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.onap.so.entity.MsoRequest;
import org.onap.so.openstack.beans.VnfRollback;
+import org.onap.so.openstack.mappers.MapAdapter;
/**
* This webservice defines the Asynchronous versions of VNF adapter calls.
@@ -54,7 +56,7 @@ public interface MsoVnfAdapterAsync
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="enableBridge") Boolean enableBridge,
@@ -72,7 +74,7 @@ public interface MsoVnfAdapterAsync
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
index 72b3795053..141dd4fe50 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
@@ -25,6 +25,7 @@ import org.openstack4j.api.OSClient.OSClientV2;
import org.openstack4j.api.OSClient.OSClientV3;
import org.openstack4j.api.exceptions.AuthenticationException;
import org.openstack4j.openstack.OSFactory;
+import org.openstack4j.model.common.Identifier;
public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
@@ -35,12 +36,14 @@ public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
Preconditions.checkNotNull(osAccess.getPassword(), "Keystone-v3 Auth: password not set.");
Preconditions.checkNotNull(osAccess.getDomainNameIdentifier(), "Keystone-v3 Auth: domain not set.");
Preconditions.checkNotNull(osAccess.getRegion(), "Keystone-v3 Auth: region not set.");
+ Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v3 Auth: tenant-id not set.");
OSClientV3 client;
try {
client = OSFactory.builderV3()
.endpoint(osAccess.getUrl())
.credentials(osAccess.getUser(), osAccess.getPassword(), osAccess.getDomainNameIdentifier())
+ .scopeToProject(Identifier.byId(osAccess.getTenantId()))
.authenticate()
.useRegion(osAccess.getRegion());
return new OpenstackV3ClientImpl(client);
@@ -54,7 +57,7 @@ public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
Preconditions.checkNotNull(osAccess.getUrl(), "Keystone-v2 Auth: endpoint not set.");
Preconditions.checkNotNull(osAccess.getUser(), "Keystone-v2 Auth: username not set.");
Preconditions.checkNotNull(osAccess.getPassword(), "Keystone-v2 Auth: password not set.");
- Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v2 Auth: domain not set.");
+ Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v2 Auth: tenant-id not set.");
Preconditions.checkNotNull(osAccess.getRegion(), "Keystone-v2 Auth: region not set.");
OSClientV2 client;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
index 29e672a4a6..1eaac18fb6 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
@@ -20,21 +20,17 @@
package org.onap.so.adapters.audit;
-import static org.hamcrest.CoreMatchers.isA;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doReturn;
import java.io.File;
import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -42,17 +38,17 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.onap.aai.domain.yang.LInterface;
import org.onap.so.audit.beans.AuditInventory;
import org.springframework.core.env.Environment;
+
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-public class AuditStackServiceDataTest extends AuditStackServiceData {
+public class AuditStackServiceDataTest extends AuditCreateStackService {
@InjectMocks
- private AuditStackServiceData auditStackService = new AuditStackServiceData();
+ private AuditCreateStackService auditStackService = new AuditCreateStackService();
@Mock
private HeatStackAudit heatStackAuditMock;
@@ -191,13 +187,13 @@ public class AuditStackServiceDataTest extends AuditStackServiceData {
@Test
public void determineAuditResult_Test() throws Exception{
- boolean actual = auditStackService.didAuditFail(auditListOptSuccess);
+ boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess);
assertEquals(false, actual);
}
@Test
public void determineAuditResult_Failure_Test() throws Exception{
- boolean actual = auditStackService.didAuditFail(auditListOptFailure);
+ boolean actual = auditStackService.didCreateAuditFail(auditListOptFailure);
assertEquals(true, actual);
}
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml
index 8e5deafd21..9fa14b1b18 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml
@@ -47,6 +47,27 @@
</configOptions>
</configuration>
</execution>
+ <execution>
+ <id>sol003-vnf-lcn-api</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json</inputSpec>
+ <language>java</language>
+ <library>okhttp-gson</library>
+ <output>${project.build.directory}/generated-sources/sol003-vnf-lcn</output>
+ <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.api</apiPackage>
+ <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model</modelPackage>
+ <configOptions>
+ <jackson>true</jackson>
+ <sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
+ <serializableModel>true</serializableModel>
+ </configOptions>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json
new file mode 100644
index 0000000000..d3b6ebaa7e
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json
@@ -0,0 +1,1897 @@
+{
+ "swagger" : "2.0",
+ "info" : {
+ "description" : "SOL003 - VNF Lifecycle Management Notification interface\n\nIMPORTANT: Please note that this file might be not aligned to the current version of the ETSI Group Specification it refers to. In case of discrepancies the published ETSI Group Specification takes precedence.\n\nIn clause 4.3.2 of ETSI GS NFV-SOL 003 v2.4.1, an attribute-based filtering mechanism is defined. This mechanism is currently not included in the corresponding OpenAPI design for this GS version. Changes to the attribute-based filtering mechanism are being considered in v2.5.1 of this GS for inclusion in the corresponding future ETSI NFV OpenAPI design.\nPlease report bugs to https://forge.etsi.org/bugzilla/buglist.cgi?component=Nfv-Openapis&list_id=61&product=NFV&resolution=\n",
+ "version" : "1.1.1",
+ "title" : "SOL003 - VNF Lifecycle Management Notification interface",
+ "license" : {
+ "name" : "ETSI Forge copyright notice",
+ "url" : "https://forge.etsi.org/etsi-forge-copyright-notice.txt"
+ }
+ },
+ "basePath" : "/so/vnfm-adapter/v1/",
+ "schemes" : [ "https" ],
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "paths" : {
+ "/lcn/VnfLcmOperationOccurrenceNotification" : {
+ "post" : {
+ "description" : "Notify\n\nThe POST method delivers a notification from the server to the client.\n",
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "VnfLcmOperationOccurrenceNotification",
+ "description" : "A notification about on-boarding of a VNF package.",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/VnfLcmOperationOccurrenceNotification"
+ }
+ }, {
+ "name" : "Authorization",
+ "in" : "header",
+ "description" : "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "Content-Type",
+ "in" : "header",
+ "description" : "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content\nThe notification was delivered successfully.\n",
+ "headers" : {
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ }
+ },
+ "400" : {
+ "description" : "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ },
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "401" : {
+ "description" : "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ },
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "403" : {
+ "description" : "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "404" : {
+ "description" : "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "405" : {
+ "description" : "Method Not Allowed\nIf a particular HTTP method is not supported for a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "406" : {
+ "description" : "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case. \n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "500" : {
+ "description" : "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "503" : {
+ "description" : "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ }
+ }
+ }
+ },
+ "/lcn/VnfIdentifierCreationNotification" : {
+ "post" : {
+ "description" : "Notify\n\nThe POST method delivers a notification from the server to the client.\n",
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "VnfIdentifierCreationNotification",
+ "description" : "A notification about the creation of a VNF identifier and the related VNF instance resource.\n",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/VnfIdentifierCreationNotification"
+ }
+ }, {
+ "name" : "Authorization",
+ "in" : "header",
+ "description" : "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "Content-Type",
+ "in" : "header",
+ "description" : "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content\nThe notification was delivered successfully.\n",
+ "headers" : {
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ }
+ },
+ "400" : {
+ "description" : "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ },
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "401" : {
+ "description" : "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ },
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "403" : {
+ "description" : "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "404" : {
+ "description" : "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "405" : {
+ "description" : "Method Not Allowed\nIf a particular HTTP method is not supported for a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "406" : {
+ "description" : "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case. \n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "500" : {
+ "description" : "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "503" : {
+ "description" : "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ }
+ }
+ }
+ },
+ "/lcn/VnfIdentifierDeletionNotification" : {
+ "post" : {
+ "description" : "Notify\n\nThe POST method delivers a notification from the server to the client.\n",
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "VnfIdentifierDeletionNotification",
+ "description" : "A notification about the deletion of a VNF identifier and the related VNF instance resource.\n",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/VnfIdentifierDeletionNotification"
+ }
+ }, {
+ "name" : "Authorization",
+ "in" : "header",
+ "description" : "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "Content-Type",
+ "in" : "header",
+ "description" : "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content\nThe notification was delivered successfully.\n",
+ "headers" : {
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ }
+ },
+ "400" : {
+ "description" : "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ },
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "401" : {
+ "description" : "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ },
+ "WWW-Authenticate" : {
+ "type" : "string",
+ "description" : "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n"
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "403" : {
+ "description" : "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "404" : {
+ "description" : "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "405" : {
+ "description" : "Method Not Allowed\nIf a particular HTTP method is not supported for a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "406" : {
+ "description" : "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case. \n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "500" : {
+ "description" : "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ },
+ "503" : {
+ "description" : "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers" : {
+ "Content-Type" : {
+ "type" : "string",
+ "description" : "The MIME type of the body of the response."
+ }
+ },
+ "schema" : {
+ "type" : "object",
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n"
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions" : {
+ "lcnVnfLcmOperationOccurrenceNotification_changedInfo_vimConnectionInfo" : {
+ "required" : [ "id", "vimType" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "vimId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "vimType" : {
+ "type" : "string",
+ "description" : "Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the \"interfaceInfo\" and \"accessInfo\" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.\n"
+ },
+ "interfaceInfo" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ },
+ "accessInfo" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ },
+ "extra" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ }
+ },
+ "description" : "This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.\n",
+ "example" : {
+ "vimType" : "vimType",
+ "vimId" : "vimId",
+ "extra" : "{}",
+ "interfaceInfo" : "{}",
+ "id" : "id",
+ "accessInfo" : "{}"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_computeResource" : {
+ "required" : [ "resourceId", "vimConnectionId" ],
+ "properties" : {
+ "vimConnectionId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "resourceProviderId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "resourceId" : {
+ "type" : "string",
+ "description" : "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n"
+ },
+ "vimLevelResourceType" : {
+ "type" : "string",
+ "description" : "Type of the resource in the scope of the VIM or the resource provider.\n"
+ }
+ },
+ "description" : "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
+ "example" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_affectedVnfcs" : {
+ "required" : [ "changeType", "computeResource", "id", "vduId" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ },
+ "vduId" : {
+ "type" : "string",
+ "description" : "An identifier that is unique within a VNF descriptor.\n"
+ },
+ "changeType" : {
+ "type" : "string",
+ "description" : "Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY For a temporary resource, an AffectedVnfc structure exists as long as the temporary resource exists.\n",
+ "enum" : [ "ADDED", "REMOVED", "MODIFIED", "TEMPORARY" ]
+ },
+ "computeResource" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_computeResource"
+ },
+ "metadata" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ },
+ "affectedVnfcCpIds" : {
+ "type" : "array",
+ "description" : "Identifiers of CP(s) of the VNFC instance that were affected by the change. Shall be present for those affected CPs of the VNFC instance that are associated to an external CP of the VNF instance. May be present for further affected CPs of the VNFC instance.\n",
+ "items" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ }
+ },
+ "addedStorageResourceIds" : {
+ "type" : "array",
+ "description" : "References to VirtualStorage resources that have been added. Each value refers to a VirtualStorageResourceInfo item in the VnfInstance that was added to the VNFC. It shall be provided if at least one storage resource was added to the VNFC.\n",
+ "items" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ }
+ },
+ "removedStorageResourceIds" : {
+ "type" : "array",
+ "description" : "References to VirtualStorage resources that have been removed. The value contains the identifier of a VirtualStorageResourceInfo item that has been removed from the VNFC, and might no longer exist in the VnfInstance. It shall be provided if at least one storage resource was removed from the VNFC.\n",
+ "items" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ }
+ }
+ },
+ "description" : "This type provides information about added, deleted, modified and temporary VNFCs. \n",
+ "example" : {
+ "addedStorageResourceIds" : [ "addedStorageResourceIds", "addedStorageResourceIds" ],
+ "metadata" : "{}",
+ "changeType" : "ADDED",
+ "affectedVnfcCpIds" : [ "affectedVnfcCpIds", "affectedVnfcCpIds" ],
+ "id" : "id",
+ "vduId" : "vduId",
+ "computeResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "removedStorageResourceIds" : [ "removedStorageResourceIds", "removedStorageResourceIds" ]
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_changedExtConnectivity" : {
+ "required" : [ "id", "resourceHandle" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "resourceHandle" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_computeResource"
+ },
+ "extLinkPorts" : {
+ "type" : "array",
+ "description" : "Link ports of this VL.\n",
+ "items" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_extLinkPorts"
+ }
+ }
+ },
+ "example" : {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "extLinkPorts" : [ {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ }, {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ } ],
+ "id" : "id"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_error" : {
+ "required" : [ "detail", "status" ],
+ "properties" : {
+ "type" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n"
+ },
+ "title" : {
+ "type" : "string",
+ "description" : "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n"
+ },
+ "status" : {
+ "type" : "integer",
+ "description" : "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n"
+ },
+ "detail" : {
+ "type" : "string",
+ "description" : "A human-readable explanation specific to this occurrence of the problem.\n"
+ },
+ "instance" : {
+ "type" : "string",
+ "format" : "URI",
+ "description" : "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n"
+ }
+ },
+ "description" : "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "example" : {
+ "instance" : "instance",
+ "detail" : "detail",
+ "type" : "type",
+ "title" : "title",
+ "status" : 0
+ }
+ },
+ "VnfLcmOperationOccurrenceNotification" : {
+ "type" : "object",
+ "required" : [ "_links", "id", "isAutomaticInvocation", "notificationStatus", "notificationType", "operation", "operationState", "subscriptionId", "timeStamp", "vnfInstanceId", "vnfLcmOpOccId" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "notificationType" : {
+ "type" : "string",
+ "description" : "Discriminator for the different notification types. Shall be set to \"VnfLcmOperationOccurrenceNotification\" for this notification type.\n",
+ "enum" : [ "VnfLcmOperationOccurrenceNotification" ]
+ },
+ "subscriptionId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "timeStamp" : {
+ "type" : "string",
+ "format" : "date-time",
+ "description" : "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n"
+ },
+ "notificationStatus" : {
+ "type" : "string",
+ "description" : "Indicates whether this notification reports about the start of a lifecycle operation or the result of a lifecycle operation. Permitted values: * START: Informs about the start of the VNF LCM operation\n occurrence.\n* RESULT: Informs about the final or intermediate result of the VNF\n LCM operation occurrence.\n",
+ "enum" : [ "START", "RESULT" ]
+ },
+ "operationState" : {
+ "type" : "string",
+ "description" : "Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.\n",
+ "enum" : [ "STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK" ]
+ },
+ "vnfInstanceId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "operation" : {
+ "type" : "string",
+ "description" : "Value | Description ------|------------ INSTANTIATE | Represents the \"Instantiate VNF\" LCM operation. SCALE | Represents the \"Scale VNF\" LCM operation. SCALE_TO_LEVEL | Represents the \"Scale VNF to Level\" LCM operation. CHANGE_FLAVOUR | Represents the \"Change VNF Flavour\" LCM operation. TERMINATE | Represents the \"Terminate VNF\" LCM operation. HEAL | Represents the \"Heal VNF\" LCM operation. OPERATE | Represents the \"Operate VNF\" LCM operation. CHANGE_EXT_CONN | Represents the \"Change external VNF connectivity\" LCM operation. MODIFY_INFO | Represents the \"Modify VNF Information\" LCM operation. \n",
+ "enum" : [ "INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO" ]
+ },
+ "isAutomaticInvocation" : {
+ "type" : "boolean",
+ "description" : "Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM (i.e. ScaleVnf / ScaleVnfToLevel triggered by auto-scale, or HealVnf triggered by auto-heal). Set to false otherwise.\n"
+ },
+ "vnfLcmOpOccId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "affectedVnfcs" : {
+ "type" : "array",
+ "description" : "Information about VNFC instances that were affected during the lifecycle operation. Shall be present if the \"notificationStatus\" is set to \"RESULT\" and the operation has performed any resource modification. Shall be absent otherwise. This attribute contains information about the cumulative changes to virtualised resources that were performed so far by the VNF LCM operation occurrence and by any of the error handling procedures for that operation occurrence.\n",
+ "items" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_affectedVnfcs"
+ }
+ },
+ "affectedVirtualLinks" : {
+ "type" : "array",
+ "description" : "Information about VL instances that were affected during the lifecycle operation. Shall be present if the \"notificationStatus\" is set to \"RESULT\" and the operation has performed any resource modification. Shall be absent otherwise. This attribute contains information about the cumulative changes to virtualised resources that were performed so far by the VNF LCM operation occurrence and by any of the error handling procedures for that operation occurrence.\n",
+ "items" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_affectedVirtualLinks"
+ }
+ },
+ "affectedVirtualStorages" : {
+ "type" : "array",
+ "description" : "Information about virtualised storage instances that were affected during the lifecycle operation. Shall be present if the \"notificationStatus\" is set to \"RESULT\" and the operation has performed any resource modification. Shall be absent otherwise. This attribute contains information about the cumulative changes to virtualised resources that were performed so far by the VNF LCM operation occurrence and by any of the error handling procedures for that operation occurrence.\n",
+ "items" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_affectedVirtualStorages"
+ }
+ },
+ "changedInfo" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_changedInfo"
+ },
+ "changedExtConnectivity" : {
+ "type" : "array",
+ "description" : "Information about changed external connectivity, if this notification represents the result of a lifecycle operation occurrence. Shall be present if the \"notificationStatus\" is set to \"RESULT\" and the \"operation\" is set to \"CHANGE_EXT_CONN\". Shall be absent otherwise.\n",
+ "items" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_changedExtConnectivity"
+ }
+ },
+ "error" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_error"
+ },
+ "_links" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification__links"
+ }
+ },
+ "description" : "This type represents a VNF lifecycle management operation occurrence notification, which informs the receiver of changes in the VNF lifecycle caused by a VNF LCM operation occurrence. The support of the notification is mandatory. This notification shall be triggered by the VNFM when there is a change in the VNF lifecycle caused by a VNF LCM operation occurrence, including: * Instantiation of the VNF * Scaling of the VNF instance (including auto-scaling) * Healing of the VNF instance (including auto-healing) * Change of the state of the VNF instance (i.e. Operate VNF) * Change of the deployment flavour of the VNF instance * Change of the external connectivity of the VNF instance * Termination of the VNF instance * Modification of VNF instance information and/or VNF configurable\n properties through the \"PATCH\" method on the \"Individual VNF instance\"\n resource.\nIf this is the initial notification about the start of a VNF LCM operation occurrence, it is assumed that the notification is sent by the VNFM before any action (including sending the grant request) is taken as part of the LCM operation. Due to possible race conditions, the \"start\" notification, the grant request and the LCM operation acknowledgment can arrive in any order at the NFVO, and the NFVO shall be able to handle such a situation. If this is a notification about a final or intermediate result state of a VNF LCM operation occurrence, the notification shall be sent after all related actions of the LCM operation that led to this state have been executed. The new state shall be set in the VnfLcmOpOcc resource before the notification about the state change is sent.\n",
+ "example" : {
+ "notificationStatus" : "START",
+ "affectedVirtualLinks" : [ {
+ "metadata" : "{}",
+ "networkResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "changeType" : "ADDED",
+ "virtualLinkDescId" : "virtualLinkDescId",
+ "id" : "id"
+ }, {
+ "metadata" : "{}",
+ "networkResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "changeType" : "ADDED",
+ "virtualLinkDescId" : "virtualLinkDescId",
+ "id" : "id"
+ } ],
+ "affectedVirtualStorages" : [ {
+ "metadata" : "{}",
+ "virtualStorageDescId" : "virtualStorageDescId",
+ "changeType" : "ADDED",
+ "id" : "id",
+ "storageResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ }
+ }, {
+ "metadata" : "{}",
+ "virtualStorageDescId" : "virtualStorageDescId",
+ "changeType" : "ADDED",
+ "id" : "id",
+ "storageResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ }
+ } ],
+ "affectedVnfcs" : [ {
+ "addedStorageResourceIds" : [ "addedStorageResourceIds", "addedStorageResourceIds" ],
+ "metadata" : "{}",
+ "changeType" : "ADDED",
+ "affectedVnfcCpIds" : [ "affectedVnfcCpIds", "affectedVnfcCpIds" ],
+ "id" : "id",
+ "vduId" : "vduId",
+ "computeResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "removedStorageResourceIds" : [ "removedStorageResourceIds", "removedStorageResourceIds" ]
+ }, {
+ "addedStorageResourceIds" : [ "addedStorageResourceIds", "addedStorageResourceIds" ],
+ "metadata" : "{}",
+ "changeType" : "ADDED",
+ "affectedVnfcCpIds" : [ "affectedVnfcCpIds", "affectedVnfcCpIds" ],
+ "id" : "id",
+ "vduId" : "vduId",
+ "computeResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "removedStorageResourceIds" : [ "removedStorageResourceIds", "removedStorageResourceIds" ]
+ } ],
+ "_links" : {
+ "subscription" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfLcmOpOcc" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfInstance" : {
+ "href" : "http://example.com/aeiou"
+ }
+ },
+ "operationState" : "STARTING",
+ "notificationType" : "VnfLcmOperationOccurrenceNotification",
+ "error" : {
+ "instance" : "instance",
+ "detail" : "detail",
+ "type" : "type",
+ "title" : "title",
+ "status" : 0
+ },
+ "timeStamp" : "2000-01-23T04:56:07.000+00:00",
+ "vnfInstanceId" : "vnfInstanceId",
+ "vnfLcmOpOccId" : "vnfLcmOpOccId",
+ "changedInfo" : {
+ "vnfProductName" : "vnfProductName",
+ "metadata" : "{}",
+ "extensions" : "{}",
+ "vimConnectionInfo" : [ {
+ "vimType" : "vimType",
+ "vimId" : "vimId",
+ "extra" : "{}",
+ "interfaceInfo" : "{}",
+ "id" : "id",
+ "accessInfo" : "{}"
+ }, {
+ "vimType" : "vimType",
+ "vimId" : "vimId",
+ "extra" : "{}",
+ "interfaceInfo" : "{}",
+ "id" : "id",
+ "accessInfo" : "{}"
+ } ],
+ "vnfdVersion" : "vnfdVersion",
+ "vnfProvider" : "vnfProvider",
+ "vnfConfigurableProperties" : "{}",
+ "vnfPkgId" : "vnfPkgId",
+ "vnfdId" : "vnfdId",
+ "vnfInstanceName" : "vnfInstanceName",
+ "vnfInstanceDescription" : "vnfInstanceDescription",
+ "vnfSoftwareVersion" : "vnfSoftwareVersion"
+ },
+ "changedExtConnectivity" : [ {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "extLinkPorts" : [ {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ }, {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ } ],
+ "id" : "id"
+ }, {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "extLinkPorts" : [ {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ }, {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ } ],
+ "id" : "id"
+ } ],
+ "id" : "id",
+ "subscriptionId" : "subscriptionId",
+ "isAutomaticInvocation" : true,
+ "operation" : "INSTANTIATE"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_extLinkPorts" : {
+ "required" : [ "id", "resourceHandle" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "resourceHandle" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_computeResource"
+ },
+ "cpInstanceId" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ }
+ },
+ "description" : "This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL. \n",
+ "example" : {
+ "resourceHandle" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "id" : "id",
+ "cpInstanceId" : "cpInstanceId"
+ }
+ },
+ "VnfIdentifierCreationNotification" : {
+ "type" : "object",
+ "required" : [ "_links", "id", "notificationType", "timeStamp", "vnfInstanceId" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "notificationType" : {
+ "type" : "string",
+ "description" : "Discriminator for the different notification types. Shall be set to \"VnfIdentifierCreationNotification\" for this notification type.\n",
+ "enum" : [ "VnfIdentifierCreationNotification" ]
+ },
+ "subscriptionId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "timeStamp" : {
+ "type" : "string",
+ "format" : "date-time",
+ "description" : "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n"
+ },
+ "vnfInstanceId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "_links" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification__links"
+ }
+ },
+ "description" : "This type represents a VNF identifier creation notification, which informs the receiver of the creation of a new VNF instance resource and the associated VNF instance identifier. This notification shall be triggered by the VNFM when it has created a VNF instance resource and the associated VNF instance identifier.\n",
+ "example" : {
+ "timeStamp" : "2000-01-23T04:56:07.000+00:00",
+ "vnfInstanceId" : "vnfInstanceId",
+ "_links" : {
+ "subscription" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfLcmOpOcc" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfInstance" : {
+ "href" : "http://example.com/aeiou"
+ }
+ },
+ "id" : "id",
+ "notificationType" : "VnfIdentifierCreationNotification",
+ "subscriptionId" : "subscriptionId"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification__links_vnfInstance" : {
+ "required" : [ "href" ],
+ "properties" : {
+ "href" : {
+ "type" : "string",
+ "format" : "url",
+ "description" : "URI of the referenced resource.\n"
+ }
+ },
+ "description" : "This type represents a link to a resource.\n",
+ "example" : {
+ "href" : "http://example.com/aeiou"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_changedInfo" : {
+ "properties" : {
+ "vnfInstanceName" : {
+ "type" : "string",
+ "description" : "If present, this attribute signals modifications of the \"vnfInstanceName\" attribute in \"VnfInstance\".\n"
+ },
+ "vnfInstanceDescription" : {
+ "type" : "string",
+ "description" : "If present, this attribute signals modifications of the \"vnfInstanceDescription\" attribute in \"VnfInstance\".\n"
+ },
+ "vnfConfigurableProperties" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ },
+ "metadata" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ },
+ "extensions" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ },
+ "vimConnectionInfo" : {
+ "type" : "array",
+ "description" : "If present, this attribute signals modifications of certain entries in the \"vimConnectionInfo\" attribute array in \"VnfInstance\".\n",
+ "items" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_changedInfo_vimConnectionInfo"
+ }
+ },
+ "vnfPkgId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "vnfdId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "vnfProvider" : {
+ "type" : "string",
+ "description" : "If present, this attribute signals modifications of the \"vnfProvider\" attribute in \"VnfInstance\". If present, this attribute (which depends on the value of the \"vnfPkgId\" attribute) was modified implicitly following a request to modify the \"vnfPkgId\" attribute, by copying the value of this attribute from the VNFD in the VNF Package identified by the \"vnfPkgId” attribute.\n"
+ },
+ "vnfProductName" : {
+ "type" : "string",
+ "description" : "If present, this attribute signals modifications of the \"vnfProductName\" attribute in \"VnfInstance\". If present, this attribute (which depends on the value of the \"vnfPkgId\" attribute) was modified implicitly following a request to modify the \"vnfPkgId\" attribute, by copying the value of this attribute from the VNFD in the VNF Package identified by the \"vnfPkgId” attribute.\n"
+ },
+ "vnfSoftwareVersion" : {
+ "type" : "string",
+ "description" : "A Version.\n"
+ },
+ "vnfdVersion" : {
+ "type" : "string",
+ "description" : "A Version.\n"
+ }
+ },
+ "description" : "This type represents attribute modifications that were performed on an \"Individual VNF instance\" resource. The attributes that can be included consist of those requested to be modified explicitly in the \"VnfInfoModificationRequest\" data structure, and additional attributes of the \"VnfInstance\" data structure that were modified implicitly e.g. when modifying the referenced VNF package.\n",
+ "example" : {
+ "vnfProductName" : "vnfProductName",
+ "metadata" : "{}",
+ "extensions" : "{}",
+ "vimConnectionInfo" : [ {
+ "vimType" : "vimType",
+ "vimId" : "vimId",
+ "extra" : "{}",
+ "interfaceInfo" : "{}",
+ "id" : "id",
+ "accessInfo" : "{}"
+ }, {
+ "vimType" : "vimType",
+ "vimId" : "vimId",
+ "extra" : "{}",
+ "interfaceInfo" : "{}",
+ "id" : "id",
+ "accessInfo" : "{}"
+ } ],
+ "vnfdVersion" : "vnfdVersion",
+ "vnfProvider" : "vnfProvider",
+ "vnfConfigurableProperties" : "{}",
+ "vnfPkgId" : "vnfPkgId",
+ "vnfdId" : "vnfdId",
+ "vnfInstanceName" : "vnfInstanceName",
+ "vnfInstanceDescription" : "vnfInstanceDescription",
+ "vnfSoftwareVersion" : "vnfSoftwareVersion"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_affectedVirtualStorages" : {
+ "required" : [ "changeType", "id", "storageResource", "virtualStorageDescId" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ },
+ "virtualStorageDescId" : {
+ "type" : "string",
+ "description" : "An identifier that is unique within a VNF descriptor.\n"
+ },
+ "changeType" : {
+ "type" : "string",
+ "description" : "Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY For a temporary resource, an AffectedVirtualStorage structure exists as long as the temporary resource exists.\n",
+ "enum" : [ "ADDED", "REMOVED", "MODIFIED", "TEMPORARY" ]
+ },
+ "storageResource" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_computeResource"
+ },
+ "metadata" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ }
+ },
+ "description" : "This type provides information about added, deleted, modified and temporary virtual storage resources.\n",
+ "example" : {
+ "metadata" : "{}",
+ "virtualStorageDescId" : "virtualStorageDescId",
+ "changeType" : "ADDED",
+ "id" : "id",
+ "storageResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ }
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification__links" : {
+ "required" : [ "subscription", "vnfInstance" ],
+ "properties" : {
+ "vnfInstance" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification__links_vnfInstance"
+ },
+ "subscription" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification__links_vnfInstance"
+ },
+ "vnfLcmOpOcc" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification__links_vnfInstance"
+ }
+ },
+ "description" : "This type represents the links to resources that a notification can contain.\n",
+ "example" : {
+ "subscription" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfLcmOpOcc" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfInstance" : {
+ "href" : "http://example.com/aeiou"
+ }
+ }
+ },
+ "VnfIdentifierDeletionNotification" : {
+ "type" : "object",
+ "required" : [ "_links", "id", "notificationType", "timeStamp", "vnfInstanceId" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "notificationType" : {
+ "type" : "string",
+ "description" : "Discriminator for the different notification types. Shall be set to \"VnfIdentifierDeletionNotification\" for this notification type.\n",
+ "enum" : [ "VnfIdentifierDeletionNotification" ]
+ },
+ "subscriptionId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "timeStamp" : {
+ "type" : "string",
+ "format" : "date-time",
+ "description" : "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n"
+ },
+ "vnfInstanceId" : {
+ "type" : "string",
+ "description" : "An identifier with the intention of being globally unique.\n"
+ },
+ "_links" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification__links"
+ }
+ },
+ "description" : "This type represents a VNF identifier deletion notification, which informs the receiver of the deletion of a new VNF instance resource and the associated VNF instance identifier. This notification shall be triggered by the VNFM when it has deleted a VNF instance resource and the associated VNF instance identifier.\n",
+ "example" : {
+ "timeStamp" : "2000-01-23T04:56:07.000+00:00",
+ "vnfInstanceId" : "vnfInstanceId",
+ "_links" : {
+ "subscription" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfLcmOpOcc" : {
+ "href" : "http://example.com/aeiou"
+ },
+ "vnfInstance" : {
+ "href" : "http://example.com/aeiou"
+ }
+ },
+ "id" : "id",
+ "notificationType" : "VnfIdentifierDeletionNotification",
+ "subscriptionId" : "subscriptionId"
+ }
+ },
+ "lcnVnfLcmOperationOccurrenceNotification_affectedVirtualLinks" : {
+ "required" : [ "changeType", "id", "networkResource", "virtualLinkDescId" ],
+ "properties" : {
+ "id" : {
+ "type" : "string",
+ "description" : "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n"
+ },
+ "virtualLinkDescId" : {
+ "type" : "string",
+ "description" : "An identifier that is unique within a VNF descriptor.\n"
+ },
+ "changeType" : {
+ "type" : "string",
+ "description" : "Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY * LINK_PORT_ADDED * LINK_PORT_REMOVED For a temporary resource, an AffectedVirtualLink structure exists as long as the temporary resource exists.\n",
+ "enum" : [ "ADDED", "REMOVED", "MODIFIED", "TEMPORARY", "LINK_PORT_ADDED", "LINK_PORT_REMOVED" ]
+ },
+ "networkResource" : {
+ "$ref" : "#/definitions/lcnVnfLcmOperationOccurrenceNotification_computeResource"
+ },
+ "metadata" : {
+ "type" : "object",
+ "description" : "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. \n",
+ "properties" : { }
+ }
+ },
+ "description" : "This type provides information about added, deleted, modified and temporary VLs.\n",
+ "example" : {
+ "metadata" : "{}",
+ "networkResource" : {
+ "resourceId" : "resourceId",
+ "vimConnectionId" : "vimConnectionId",
+ "vimLevelResourceType" : "vimLevelResourceType",
+ "resourceProviderId" : "resourceProviderId"
+ },
+ "changeType" : "ADDED",
+ "virtualLinkDescId" : "virtualLinkDescId",
+ "id" : "id"
+ }
+ }
+ },
+ "externalDocs" : {
+ "description" : "ETSI GS NFV-SOL 003 V2.4.1",
+ "url" : "http://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.04.01_60/gs_NFV-SOL003v020401p.pdf"
+ }
+} \ No newline at end of file
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml
index d932c4e768..f97c1b8c56 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml
@@ -45,6 +45,19 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <so.log.level>DEBUG</so.log.level>
+ </systemPropertyVariables>
+ <rerunFailingTestsCount>2</rerunFailingTestsCount>
+ <parallel>suites</parallel>
+ <useUnlimitedThreads>false</useUnlimitedThreads>
+ <threadCount>1</threadCount>
+ </configuration>
+ </plugin>
</plugins>
</build>
<dependencies>
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
index 893df02019..bacbea141e 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
@@ -30,6 +30,8 @@ import org.onap.aai.domain.yang.Relationship;
import org.onap.aai.domain.yang.RelationshipData;
import org.onap.aai.domain.yang.RelationshipList;
import org.onap.aai.domain.yang.Tenant;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs;
import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIVersion;
@@ -172,4 +174,43 @@ public class AaiHelper {
return false;
}
+ /**
+ * Create a vserver.
+ *
+ * @param vnfc the VNFC to base the vserver on
+ * @return the vserver
+ */
+ public Vserver createVserver(final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc) {
+ final Vserver vserver = new Vserver();
+ vserver.setVserverId(vnfc.getComputeResource().getResourceId());
+ vserver.setVserverName(vnfc.getId());
+ vserver.setProvStatus("active");
+ vserver.setVserverSelflink("Not available");
+ return vserver;
+ }
+
+ /**
+ * Add a relationship to the given vserver to the given VNF.
+ *
+ * @param vnf the vserver
+ * @param vnfmId the ID of the VNF
+ */
+ public void addRelationshipFromVserverVnfToGenericVnf(final Vserver vserver, final String vnfId) {
+ if (vserver.getRelationshipList() == null) {
+ vserver.setRelationshipList(new RelationshipList());
+ }
+ final RelationshipList vserverRelationshiplist = vserver.getRelationshipList();
+ vserverRelationshiplist.getRelationship().add(createRelationshipToGenericVnf(vnfId));
+ }
+
+ private Relationship createRelationshipToGenericVnf(final String vnfId) {
+ final Relationship relationship = new Relationship();
+ relationship.setRelatedTo("generic-vnf");
+ relationship.setRelationshipLabel("tosca.relationships.HostedOn");
+ relationship.setRelatedLink("/aai/" + AAIVersion.LATEST
+ + AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).build().toString());
+ relationship.getRelationshipData().add(createRelationshipData("generic-vnf.vnf-id", vnfId));
+ return relationship;
+ }
+
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
index d11da0c91b..a043bb85b6 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
@@ -20,11 +20,13 @@
package org.onap.so.adapters.vnfmadapter.extclients.aai;
+import java.util.List;
import org.onap.aai.domain.yang.EsrSystemInfoList;
import org.onap.aai.domain.yang.EsrVnfm;
import org.onap.aai.domain.yang.EsrVnfmList;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.Tenant;
+import org.onap.aai.domain.yang.Vserver;
/**
* Provides methods for invoking REST calls to AAI.
@@ -40,6 +42,14 @@ public interface AaiServiceProvider {
GenericVnf invokeGetGenericVnf(final String vnfId);
/**
+ * Invoke a query for a generic VNF with the given selfLink
+ *
+ * @param selfLink the selfLink
+ * @return the matching generic vnfs
+ */
+ List<GenericVnf> invokeQueryGenericVnf(final String selfLink);
+
+ /**
* Invoke a GET request for the VNFMs.
*
* @return the VNFMs
@@ -70,6 +80,18 @@ public interface AaiServiceProvider {
void invokePutGenericVnf(GenericVnf vnf);
/**
+ * Invoke a PUT request for a vserver.
+ *
+ * @param cloudOwner the cloud owner
+ * @param cloudRegion the cloud region
+ * @param tenantId the ID of the tenant
+ * @param vserver the vserver
+ * @return
+ */
+ void invokePutVserver(final String cloudOwner, final String cloudRegion, final String tenantId,
+ final Vserver vserver);
+
+ /**
* Invoke a GET request for the a tenant.
*
* @param cloudOwner the cloud owner
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
index fa0dcf07f1..364a6415a8 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
@@ -20,11 +20,13 @@
package org.onap.so.adapters.vnfmadapter.extclients.aai;
+import java.util.List;
import org.onap.aai.domain.yang.EsrSystemInfoList;
import org.onap.aai.domain.yang.EsrVnfm;
import org.onap.aai.domain.yang.EsrVnfmList;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.Tenant;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.slf4j.Logger;
@@ -54,6 +56,17 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
}
@Override
+ public List<GenericVnf> invokeQueryGenericVnf(final String selfLink) {
+ return aaiClientProvider.getAaiClient()
+ .get(List.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNFS).queryParam("selflink", selfLink))
+ .orElseGet(() -> {
+ logger.debug("No vnf found in AAI with selflink: {}", selfLink);
+ return null;
+ });
+ }
+
+ @Override
public EsrVnfmList invokeGetVnfms() {
return aaiClientProvider.getAaiClient()
.get(EsrVnfmList.class, AAIUriFactory.createResourceUri(AAIObjectType.VNFM_LIST)).orElseGet(() -> {
@@ -89,6 +102,13 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
}
@Override
+ public void invokePutVserver(final String cloudOwner, final String cloudRegion, final String tenant,
+ final Vserver vserver) {
+ aaiClientProvider.getAaiClient().update(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner,
+ cloudRegion, tenant, vserver.getVserverId()), vserver);
+ }
+
+ @Override
public Tenant invokeGetTenant(final String cloudOwner, final String cloudRegion, final String tenantId) {
return aaiClientProvider.getAaiClient()
.get(Tenant.class,
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java
new file mode 100644
index 0000000000..36b197dd06
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java
@@ -0,0 +1,159 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.notificationhandling;
+
+import static org.slf4j.LoggerFactory.getLogger;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper;
+import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo;
+import org.slf4j.Logger;
+
+/**
+ * Performs updates to AAI based on a received notification. The updates are executed in a separate
+ * thread so as the notification response to the VNFM is not delayed.
+ */
+public class NotificationHandler implements Runnable {
+ private static Logger logger = getLogger(NotificationHandler.class);
+ private final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification;
+ private final AaiHelper aaiHelper;
+ private final AaiServiceProvider aaiServiceProvider;
+
+
+ private final InlineResponse201 vnfInstance;
+
+ public NotificationHandler(final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification,
+ final AaiHelper aaiHelper, final AaiServiceProvider aaiServiceProvider,
+ final InlineResponse201 vnfInstance) {
+ this.vnfLcmOperationOccurrenceNotification = vnfLcmOperationOccurrenceNotification;
+ this.aaiHelper = aaiHelper;
+ this.aaiServiceProvider = aaiServiceProvider;
+ this.vnfInstance = vnfInstance;
+ }
+
+ @Override
+ public void run() {
+ try {
+ if (vnfLcmOperationOccurrenceNotification.getOperationState().equals(OperationStateEnum.COMPLETED)) {
+ final GenericVnf genericVnf =
+ aaiServiceProvider.invokeQueryGenericVnf(vnfInstance.getLinks().getSelf().getHref()).get(0);
+
+ switch (vnfLcmOperationOccurrenceNotification.getOperation()) {
+ case INSTANTIATE:
+ handleVnfInstantiated(genericVnf);
+ break;
+ default:
+ }
+ }
+ } catch (final Exception exception) {
+ logger.error("Error encountered handling notification, AAI may not be updated correctly "
+ + vnfLcmOperationOccurrenceNotification, exception);
+ }
+ }
+
+ private void handleVnfInstantiated(final GenericVnf genericVnf) {
+ final String ipAddress = getOamIpAddress(vnfInstance);
+ logger.debug("Updating " + genericVnf.getVnfId() + " with VNF OAM IP ADDRESS: " + ipAddress);
+ genericVnf.setIpv4OamAddress(ipAddress);
+ genericVnf.setOrchestrationStatus("Created");
+
+ aaiServiceProvider.invokePutGenericVnf(genericVnf);
+
+ updateVservers(vnfLcmOperationOccurrenceNotification, genericVnf.getVnfId(),
+ vnfInstance.getVimConnectionInfo());
+
+ logger.debug("Finished handling notification for vnfm: " + vnfInstance.getId());
+ }
+
+ private String getOamIpAddress(final InlineResponse201 vnfInstance) {
+ try {
+ logger.debug("ConfigurableProperties: " + vnfInstance.getVnfConfigurableProperties());
+ if (vnfInstance.getVnfConfigurableProperties() == null) {
+ logger.warn("No ConfigurableProperties, cannot set OAM IP Address");
+ return null;
+ }
+ final JSONObject properties = new JSONObject((Map) vnfInstance.getVnfConfigurableProperties());
+ return properties.get("vnfIpAddress").toString();
+ } catch (final JSONException jsonException) {
+ logger.error("Error getting vnfIpAddress", jsonException);
+ return null;
+ }
+ }
+
+ private void updateVservers(final VnfLcmOperationOccurrenceNotification notification, final String vnfId,
+ final List<InlineResponse201VimConnectionInfo> vnfInstancesVimConnectionInfo) {
+ final Map<String, InlineResponse201VimConnectionInfo> vimConnectionIdToVimConnectionInfo = new HashMap<>();
+ for (final InlineResponse201VimConnectionInfo vimConnectionInfo : vnfInstancesVimConnectionInfo) {
+ vimConnectionIdToVimConnectionInfo.put(vimConnectionInfo.getId(), vimConnectionInfo);
+ }
+
+ for (final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc : notification.getAffectedVnfcs()) {
+
+ switch (vnfc.getChangeType()) {
+ case ADDED:
+ final Vserver vserver = aaiHelper.createVserver(vnfc);
+ aaiHelper.addRelationshipFromVserverVnfToGenericVnf(vserver, vnfId);
+ final InlineResponse201VimConnectionInfo vimConnectionInfo =
+ getVimConnectionInfo(vimConnectionIdToVimConnectionInfo, vnfc);
+ aaiServiceProvider.invokePutVserver(getCloudOwner(vimConnectionInfo),
+ getCloudRegion(vimConnectionInfo), getTenant(vimConnectionInfo), vserver);
+ break;
+ case REMOVED:
+ case MODIFIED:
+ case TEMPORARY:
+ default:
+ }
+ }
+ }
+
+ private InlineResponse201VimConnectionInfo getVimConnectionInfo(
+ final Map<String, InlineResponse201VimConnectionInfo> vimConnectionIdToVimConnectionInfo,
+ final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc) {
+ final String vimConnectionId = vnfc.getComputeResource().getVimConnectionId();
+ return vimConnectionIdToVimConnectionInfo.get(vimConnectionId);
+ }
+
+ private String getCloudOwner(final InlineResponse201VimConnectionInfo vimConnectionInfo) {
+ final String vimId = vimConnectionInfo.getVimId();
+ return vimId.substring(0, vimId.indexOf("_"));
+ }
+
+ private String getCloudRegion(final InlineResponse201VimConnectionInfo vimConnectionInfo) {
+ final String vimId = vimConnectionInfo.getVimId();
+ return vimId.substring(vimId.indexOf("_") + 1);
+ }
+
+ private String getTenant(final InlineResponse201VimConnectionInfo vimConnectionInfo) {
+ final JSONObject vimConnectionJsonObject = new JSONObject(vimConnectionInfo);
+ return vimConnectionJsonObject.getJSONObject("accessInfo").get("projectId").toString();
+ }
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java
new file mode 100644
index 0000000000..60f3f51e52
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest;
+
+import static org.onap.so.adapters.vnfmadapter.Constants.BASE_URL;
+import static org.slf4j.LoggerFactory.getLogger;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import javax.ws.rs.core.MediaType;
+import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper;
+import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfIdentifierCreationNotification;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfIdentifierDeletionNotification;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.notificationhandling.NotificationHandler;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * Controller for handling notifications from the VNFM (Virtual Network Function Manager).
+ */
+@Controller
+@RequestMapping(value = BASE_URL, produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML},
+ consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+public class Sol003LcnContoller {
+ private static Logger logger = getLogger(Sol003LcnContoller.class);
+ private static final String LOG_LCN_RECEIVED = "LCN received from VNFM: ";
+ private final AaiServiceProvider aaiServiceProvider;
+ private final AaiHelper aaiHelper;
+ private final VnfmServiceProvider vnfmServiceProvider;
+ private final ExecutorService executor = Executors.newCachedThreadPool();
+
+ @Autowired
+ Sol003LcnContoller(final AaiServiceProvider aaiServiceProvider, final AaiHelper aaiHelper,
+ final VnfmServiceProvider vnfmServiceProvider) {
+ this.aaiServiceProvider = aaiServiceProvider;
+ this.aaiHelper = aaiHelper;
+ this.vnfmServiceProvider = vnfmServiceProvider;
+ }
+
+ @PostMapping(value = "/lcn/VnfIdentifierCreationNotification")
+ public ResponseEntity<Void> lcnVnfIdentifierCreationNotificationPost(
+ @RequestBody final VnfIdentifierCreationNotification vnfIdentifierCreationNotification) {
+ logger.info(LOG_LCN_RECEIVED + vnfIdentifierCreationNotification);
+ return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+ }
+
+ @PostMapping(value = "/lcn/VnfIdentifierDeletionNotification")
+ public ResponseEntity<Void> lcnVnfIdentifierDeletionNotificationPost(
+ @RequestBody final VnfIdentifierDeletionNotification vnfIdentifierDeletionNotification) {
+ logger.info(LOG_LCN_RECEIVED + vnfIdentifierDeletionNotification);
+ return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+ }
+
+ @PostMapping(value = "/lcn/VnfLcmOperationOccurrenceNotification")
+ public ResponseEntity<Void> lcnVnfLcmOperationOccurrenceNotificationPost(
+ @RequestBody final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification) {
+ logger.info(LOG_LCN_RECEIVED + vnfLcmOperationOccurrenceNotification);
+
+ final OperationEnum operation = vnfLcmOperationOccurrenceNotification.getOperation();
+ if ((operation.equals(OperationEnum.INSTANTIATE))
+ && vnfLcmOperationOccurrenceNotification.getOperationState().equals(OperationStateEnum.COMPLETED)) {
+ final InlineResponse201 vnfInstance = getVnfInstance(vnfLcmOperationOccurrenceNotification);
+ final NotificationHandler handler = new NotificationHandler(vnfLcmOperationOccurrenceNotification,
+ aaiHelper, aaiServiceProvider, vnfInstance);
+ executor.execute(handler);
+ }
+
+ logger.info("Sending notification response");
+ return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+ }
+
+ private InlineResponse201 getVnfInstance(
+ final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification) {
+ return vnfmServiceProvider.getVnf(vnfLcmOperationOccurrenceNotification.getLinks().getVnfInstance().getHref())
+ .get();
+ }
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java
new file mode 100644
index 0000000000..b3fbcaa3b4
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java
@@ -0,0 +1,255 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.verify;
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
+import com.google.gson.Gson;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.hamcrest.MockitoHamcrest;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.Relationship;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
+import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationComputeResource;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinks;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfIdentifierCreationNotification;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo;
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.client.MockRestServiceServer;
+import org.springframework.web.client.RestTemplate;
+
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class Sol003LcnControllerTest {
+
+ private static final String CLOUD_OWNER = "myTestCloudOwner";
+ private static final String REGION = "myTestRegion";
+ private static final String TENANT_ID = "myTestTenantId";
+
+ @LocalServerPort
+ private int port;
+ @Autowired
+ @Qualifier(CONFIGURABLE_REST_TEMPLATE)
+ private RestTemplate testRestTemplate;
+ private MockRestServiceServer mockRestServer;
+
+ @MockBean
+ private AAIResourcesClient aaiResourcesClient;
+
+ @Autowired
+ private Sol003LcnContoller controller;
+ private final Gson gson = new Gson();
+
+ @Before
+ public void setUp() throws Exception {
+ mockRestServer = MockRestServiceServer.bindTo(testRestTemplate).build();
+ }
+
+ @Test
+ public void lcnNotification_IdentifierCreated_Returns204() throws URISyntaxException, InterruptedException {
+ final VnfIdentifierCreationNotification vnfIdentifierCreationNotification =
+ new VnfIdentifierCreationNotification();
+ final ResponseEntity<Void> response =
+ controller.lcnVnfIdentifierCreationNotificationPost(vnfIdentifierCreationNotification);
+ assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode());
+ }
+
+ @Test
+ public void lcnNotification_IdentifierDeleted_Returns204() throws URISyntaxException, InterruptedException {
+ final VnfIdentifierCreationNotification vnfIdentifierCreationNotification =
+ new VnfIdentifierCreationNotification();
+ final ResponseEntity<Void> response =
+ controller.lcnVnfIdentifierCreationNotificationPost(vnfIdentifierCreationNotification);
+ assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode());
+ }
+
+ @Test
+ public void lcnNotification_InstantiateCompleted_AaiUpdated() throws URISyntaxException, InterruptedException {
+ final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification = createNotification();
+ final InlineResponse201 vnfInstance = createVnfInstance();
+
+ mockRestServer.expect(requestTo(new URI("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm")))
+ .andRespond(withSuccess(gson.toJson(vnfInstance), MediaType.APPLICATION_JSON));
+
+ final GenericVnf genericVnf = createGenericVnf("vnfmType1");
+ final List<GenericVnf> genericVnfs = new ArrayList<>();
+ genericVnfs.add(genericVnf);
+ doReturn(Optional.of(genericVnfs)).when(aaiResourcesClient).get(eq(List.class),
+ MockitoHamcrest.argThat(new AaiResourceUriMatcher(
+ "/network/generic-vnfs?selflink=http%3A%2F%2Fvnfm%3A8080%2Fvnfs%2FmyTestVnfIdOnVnfm")));
+
+ final ResponseEntity<Void> response =
+ controller.lcnVnfLcmOperationOccurrenceNotificationPost(vnfLcmOperationOccurrenceNotification);
+ assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode());
+
+ final ArgumentCaptor<Object> bodyArgument = ArgumentCaptor.forClass(Object.class);
+ final ArgumentCaptor<AAIResourceUri> uriArgument = ArgumentCaptor.forClass(AAIResourceUri.class);
+
+ verify(aaiResourcesClient, timeout(1000).times(2)).update(uriArgument.capture(), bodyArgument.capture());
+
+ assertEquals("/network/generic-vnfs/generic-vnf/myTestVnfId",
+ uriArgument.getAllValues().get(0).build().toString());
+ final GenericVnf updatedGenericVnf = (GenericVnf) bodyArgument.getAllValues().get(0);
+ assertEquals("10.10.10.10", updatedGenericVnf.getIpv4OamAddress());
+ assertEquals("Created", updatedGenericVnf.getOrchestrationStatus());
+
+ assertEquals(
+ "/cloud-infrastructure/cloud-regions/cloud-region/" + CLOUD_OWNER + "/" + REGION + "/tenants/tenant/"
+ + TENANT_ID + "/vservers/vserver/myVnfc1",
+ uriArgument.getAllValues().get(1).build().toString());
+
+ final Vserver vserver = (Vserver) bodyArgument.getAllValues().get(1);
+ assertEquals("myVnfc1", vserver.getVserverId());
+ final Relationship relationship = vserver.getRelationshipList().getRelationship().get(0);
+ assertEquals("generic-vnf", relationship.getRelatedTo());
+ assertEquals("tosca.relationships.HostedOn", relationship.getRelationshipLabel());
+ assertEquals("/aai/v15/network/generic-vnfs/generic-vnf/myTestVnfId", relationship.getRelatedLink());
+ assertEquals("generic-vnf.vnf-id", relationship.getRelationshipData().get(0).getRelationshipKey());
+ assertEquals("myTestVnfId", relationship.getRelationshipData().get(0).getRelationshipValue());
+ }
+
+ private VnfLcmOperationOccurrenceNotification createNotification() {
+ final VnfLcmOperationOccurrenceNotification notification = new VnfLcmOperationOccurrenceNotification();
+ notification.setOperation(OperationEnum.INSTANTIATE);
+ notification.setOperationState(OperationStateEnum.COMPLETED);
+
+ final LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance linkToVnfInstance =
+ new LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance()
+ .href("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm");
+ final LcnVnfLcmOperationOccurrenceNotificationLinks operationLinks =
+ new LcnVnfLcmOperationOccurrenceNotificationLinks().vnfInstance(linkToVnfInstance);
+ notification.setLinks(operationLinks);
+
+ final List<LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs> affectedVnfcs = new ArrayList<>();;
+ final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc =
+ new LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs();
+ vnfc.changeType(ChangeTypeEnum.ADDED);
+ final LcnVnfLcmOperationOccurrenceNotificationComputeResource computeResource =
+ new LcnVnfLcmOperationOccurrenceNotificationComputeResource();
+ computeResource.setResourceId("myVnfc1");
+ computeResource.setVimConnectionId(CLOUD_OWNER + "_" + REGION);
+ vnfc.setComputeResource(computeResource);
+ affectedVnfcs.add(vnfc);
+ notification.setAffectedVnfcs(affectedVnfcs);
+ return notification;
+ }
+
+ private InlineResponse201 createVnfInstance() {
+ final InlineResponse201 vnfInstance = new InlineResponse201();
+ final InlineResponse201LinksSelf selfLink = new InlineResponse201LinksSelf();
+ selfLink.setHref("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm");
+ final InlineResponse201Links VnfInstancelinks = new InlineResponse201Links();
+ VnfInstancelinks.setSelf(selfLink);
+ vnfInstance.setLinks(VnfInstancelinks);
+
+ final Map<String, String> vnfConfigurableProperties = new HashMap<>();
+ vnfConfigurableProperties.put("vnfIpAddress", "10.10.10.10");
+ vnfInstance.setVnfConfigurableProperties(vnfConfigurableProperties);
+
+ final List<InlineResponse201VimConnectionInfo> vimConnectionInfo = new ArrayList<>();;
+ final InlineResponse201VimConnectionInfo vimConnection = new InlineResponse201VimConnectionInfo();
+ vimConnection.setVimId(CLOUD_OWNER + "_" + REGION);
+ vimConnection.setId(CLOUD_OWNER + "_" + REGION);
+ final AccessInfo accessInfo = new AccessInfo();
+ accessInfo.setProjectId(TENANT_ID);
+ vimConnection.setAccessInfo(accessInfo);
+ vimConnectionInfo.add(vimConnection);
+ vnfInstance.setVimConnectionInfo(vimConnectionInfo);
+ return vnfInstance;
+ }
+
+ private GenericVnf createGenericVnf(final String type) {
+ final GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId("myTestVnfId");
+ genericVnf.setNfType(type);
+ return genericVnf;
+ }
+
+ private class AaiResourceUriMatcher extends BaseMatcher<AAIResourceUri> {
+
+ final String uriAsString;
+
+ public AaiResourceUriMatcher(final String uriAsString) {
+ this.uriAsString = uriAsString;
+ }
+
+ @Override
+ public boolean matches(final Object item) {
+ if (item instanceof AAIResourceUri) {
+ if (uriAsString.endsWith("...")) {
+ return ((AAIResourceUri) item).build().toString()
+ .startsWith(uriAsString.substring(0, uriAsString.indexOf("...")));
+ }
+ return ((AAIResourceUri) item).build().toString().equals(uriAsString);
+ }
+ return false;
+ }
+
+ @Override
+ public void describeTo(final Description description) {}
+
+ }
+
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java
index 5868da563c..d2651e6055 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java
@@ -21,6 +21,7 @@
package org.onap.so.bpmn.servicedecomposition.bbobjects;
import java.io.Serializable;
+import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@@ -39,6 +40,14 @@ public class LineOfBusiness implements Serializable, ShallowCopy<LineOfBusiness>
@JsonProperty("line-of-business-name")
private String lineOfBusinessName;
+ public LineOfBusiness() {
+ }
+
+
+ public LineOfBusiness(String lineOfBusinessName) {
+ this.lineOfBusinessName = lineOfBusinessName;
+ }
+
public String getLineOfBusinessName() {
return lineOfBusinessName;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Platform.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Platform.java
index 642417fa56..d13707deb4 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Platform.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Platform.java
@@ -38,6 +38,14 @@ public class Platform implements Serializable, ShallowCopy<Platform> {
@Id
@JsonProperty("platform-name")
private String platformName;
+
+ public Platform() {
+ }
+
+
+ public Platform(String platformName) {
+ this.platformName = platformName;
+ }
public String getPlatformName() {
return platformName;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
index 7a967d3159..750b7ace35 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2019 TechMahindra
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -130,13 +132,15 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
//CDSProcessingListener cdsProcessingListener = new AbstractCDSProcessingBBUtils();
- CDSProcessingClient cdsClient = new CDSProcessingClient(this);
- CountDownLatch countDownLatch = cdsClient.sendRequest(executionServiceInput);
-
+ CDSProcessingClient cdsClient = null;
+ CountDownLatch countDownLatch;
try {
+ cdsClient = new CDSProcessingClient(this);
+ countDownLatch = cdsClient.sendRequest(executionServiceInput);
countDownLatch.await(props.getTimeout(), TimeUnit.SECONDS);
} catch (InterruptedException ex) {
logger.error("Caught exception in sendRequestToCDSClient in AbstractCDSProcessingBBUtils : ", ex);
+ Thread.currentThread().interrupt();
} finally {
cdsClient.close();
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
index 80d8d928aa..80625dd4d5 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
@@ -552,6 +552,21 @@ public class StubResponseAAI {
.withBodyFile(responseFile)));
}
+ public static void MockPostNetwork(WireMockServer wireMockServer, String networkId) {
+ wireMockServer.stubFor(post(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
+ .willReturn(aResponse()
+ .withStatus(201)
+ .withHeader("Content-Type", "text/xml")));
+ }
+
+ public static void MockPostNetworkSubnet(WireMockServer wireMockServer, String networkId, String subnetId) {
+ wireMockServer.stubFor(post(urlMatching(
+ "/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "/subnets/subnet/" + subnetId))
+ .willReturn(aResponse()
+ .withStatus(201)
+ .withHeader("Content-Type", "text/xml")));
+ }
+
public static void MockGetNetworkName(WireMockServer wireMockServer, String networkPolicyName, String responseFile, int statusCode) {
wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
.willReturn(aResponse()
@@ -560,13 +575,19 @@ public class StubResponseAAI {
.withBodyFile(responseFile)));
}
- public static void MockGetNetworkVpnBinding(WireMockServer wireMockServer, String responseFile, String vpnBinding) {
- wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
+ public static void MockGetNetworkVpnBinding(WireMockServer wireMockServer, String responseFile, String vpnBinding) {
+ MockGetNetworkVpnBindingWithDepth(wireMockServer, responseFile, vpnBinding, "all");
+ }
+
+ public static void MockGetNetworkVpnBindingWithDepth(WireMockServer wireMockServer, String responseFile,
+ String vpnBinding, String depth) {
+ wireMockServer.stubFor(
+ get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + vpnBinding + "[?]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
public static void MockGetNetworkPolicy(WireMockServer wireMockServer, String responseFile, String policy) {
wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java
index b2812d9bfb..161f879716 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java
@@ -20,28 +20,36 @@
package org.onap.so.client.cds;
-import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.UUID;
import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.exception.ExceptionBuilder;
-@RunWith(JUnit4.class)
+@RunWith(MockitoJUnitRunner.class)
public class AbstractCDSProcessingBBUtilsTest {
@InjectMocks
private AbstractCDSProcessingBBUtils abstractCDSProcessingBBUtils = new AbstractCDSProcessingBBUtils();
@InjectMocks
AbstractCDSPropertiesBean abstractCDSPropertiesBean = new AbstractCDSPropertiesBean();
+ @Mock
+ ExceptionBuilder exceptionUtil;
- @Test
- public void preProcessRequestTest() throws Exception {
+ @Before
+ public void init(){
String requestObject = "{\"config-assign-request\":{\"resolution-key\":\"resolutionKey\", \"config-assign-properties\":{\"service-instance-id\":\"serviceInstanceId\", \"vnf-id\":\"vnfId\", \"vnf-name\":\"vnfName\", \"service-model-uuid\":\"serviceModelUuid\", \"vnf-customization-uuid\":\"vnfCustomizationUuid\",\"Instance1\":\"Instance1Value\",\"Instance2\":\"Instance2Value\",\"Param3\":\"Param3Value\"}}}";
String blueprintName = "blueprintName";
String blueprintVersion = "blueprintVersion";
@@ -59,12 +67,28 @@ public class AbstractCDSProcessingBBUtilsTest {
abstractCDSPropertiesBean.setRequestId(requestId);
abstractCDSPropertiesBean.setRequestObject(requestObject);
abstractCDSPropertiesBean.setSubRequestId(subRequestId);
+ }
+
+ @Test
+ public void preProcessRequestTest() throws Exception {
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable("executionObject")).thenReturn(abstractCDSPropertiesBean);
abstractCDSProcessingBBUtils.constructExecutionServiceInputObject(execution);
- assertTrue(true);
+ verify(exceptionUtil, times(0))
+ .buildAndThrowWorkflowException(any(DelegateExecution.class), anyInt(), any(Exception.class));
+ }
+
+ @Test
+ public void sendRequestToCDSClientTest() {
+
+ DelegateExecution execution = mock(DelegateExecution.class);
+ when(execution.getVariable("executionServiceInput")).thenReturn(abstractCDSPropertiesBean);
+ abstractCDSProcessingBBUtils.sendRequestToCDSClient(execution);
+ verify(exceptionUtil, times(1))
+ .buildAndThrowWorkflowException(any(DelegateExecution.class), anyInt(), any(Exception.class));
+
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
index 6acf2223b0..c419f0dc7d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
@@ -170,7 +170,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
execution.setVariable(prefix+'volumeGroupHeatStackId', heatStackId)
logger.debug('Heat stack id from AAI response: ' + heatStackId)
- AAIResultWrapper wrapper = getAAIClient().get(uri);
+ AAIResultWrapper wrapper = getAAIClient().get(resourceUri);
Optional<Relationships> relationships = wrapper.getRelationships()
String volumeGroupTenantId = null
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
index 430c16bbef..6162780b27 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
@@ -782,7 +782,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String source = execution.getVariable(Prefix + "source")
String requestInput = execution.getVariable(Prefix + "networkRequest")
- String queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse")
+ L3Network queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse")
String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo")
String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
index ab7b659b51..0344206145 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
@@ -297,6 +297,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
public void prepVnfAdapterRest(DelegateExecution execution, isDebugLogEnabled) {
def aicCloudRegion = execution.getVariable('UPDVfModVol_aicCloudRegion')
+ def cloudOwner = execution.getVariable("UPDVfModVol_cloudRegion")
def tenantId = execution.getVariable('UPDVfModVol_tenantId')
def volumeGroupId = execution.getVariable('UPDVfModVol_volumeGroupId')
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
index eab1b89e10..2885d6919e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -26,21 +28,25 @@ import org.camunda.bpm.engine.RepositoryService
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.camunda.bpm.engine.repository.ProcessDefinition
+import org.junit.After
+import org.junit.AfterClass
import org.junit.Assert
import org.junit.Before
-import org.junit.Ignore
+import org.junit.BeforeClass
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.Captor
+import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.MockitoAnnotations
import org.mockito.Spy
-import org.mockito.runners.MockitoJUnitRunner
+import org.mockito.junit.MockitoJUnitRunner
import org.onap.aai.domain.yang.VolumeGroup
import org.onap.so.bpmn.common.scripts.MsoGroovyTest
import org.onap.so.bpmn.common.scripts.utils.XmlComparator
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.mock.FileUtil
import org.onap.so.client.aai.AAIObjectType
@@ -48,73 +54,111 @@ import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException
+import org.springframework.core.env.Environment
+import org.springframework.mock.env.MockEnvironment
import javax.ws.rs.NotFoundException
import static com.github.tomakehurst.wiremock.client.WireMock.*
import static org.mockito.Mockito.*
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.Silent.class)
class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090)
+
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
@Spy
- DoDeleteVfModuleVolumeV2 deleteVfModuleVolumeV2;
+ DoDeleteVfModuleVolumeV2 deleteVfModuleVolumeV2
+
+ @Mock
+ Environment mockEnvironment
+
+ private String Prefix = "DDVMV_"
+ private RepositoryService mockRepositoryService
+
+
+ @After
+ void cleanupEnv() {
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(null)
+ }
@Before
public void init() throws IOException {
super.init("DoDeleteVfModuleVolumeV2")
MockitoAnnotations.initMocks(this);
when(deleteVfModuleVolumeV2.getAAIClient()).thenReturn(client)
-
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.version")).thenReturn("14")
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.namespace")).thenReturn("defaultTestNamespace")
+ when(mockEnvironment.getProperty("aai.endpoint")).thenReturn("http://localhost:8090")
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(mockEnvironment)
}
@Test
public void testCallRESTQueryAAICloudRegion() {
ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn("DDVMV_")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("12345")
- when(mockExecution.getVariable("mso.workflow.DoDeleteVfModuleVolumeV2.aai.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/")
+ mockSuccessfulCloudData()
- mockData()
DoDeleteVfModuleVolumeV2 obj = new DoDeleteVfModuleVolumeV2()
obj.callRESTQueryAAICloudRegion(mockExecution, "true")
Mockito.verify(mockExecution).setVariable("DDVMV_queryCloudRegionReturnCode", "200")
Mockito.verify(mockExecution).setVariable("DDVMV_aicCloudRegion", "RDM2WAGPLCP")
}
- @Test
+ @Test(expected = GroovyRuntimeException.class)
public void testCallRESTQueryAAICloudRegionAAiEndpointNull() {
ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn("DDVMV_")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("12345")
- when(mockExecution.getVariable("mso.workflow.DoDeleteVfModuleVolumeV2.aai.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn(null)
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/")
+ when(mockEnvironment.getProperty("aai.endpoint")).thenReturn(null)
- mockData()
+ mockSuccessfulCloudData()
try {
DoDeleteVfModuleVolumeV2 obj = new DoDeleteVfModuleVolumeV2()
obj.callRESTQueryAAICloudRegion(mockExecution, "true")
} catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
+ println " Test End - Handle catch-throw Exception! "
+ Mockito.verify(mockExecution).getVariable(eq("lcpCloudRegionId"))
+ Assert.assertEquals(GroovyRuntimeException.class, ex.class)
+ throw ex
}
- Mockito.verify(mockExecution,atLeastOnce()).setVariable(captor.capture(),captor.capture())
- WorkflowException workflowException = captor.getValue()
- Assert.assertEquals(9999, workflowException.getErrorCode())
+ }
+
+ @Test
+ public void testCallRESTQueryAAICloudRegionNotFound() {
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("12345")
+ when(mockExecution.getVariable(Prefix + "queryCloudRegionReturnCode")).thenReturn("404")
+
+ wireMockRule.stubFor(
+ get(urlMatching(".*/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/12345"))
+ .willReturn(aResponse()
+ .withStatus(404)))
+
+ DoDeleteVfModuleVolumeV2 obj = new DoDeleteVfModuleVolumeV2()
+ obj.callRESTQueryAAICloudRegion(mockExecution, "true")
+
+ Mockito.verify(mockExecution).getVariable(eq("lcpCloudRegionId"))
+ Mockito.verify(mockExecution).setVariable(eq(Prefix + "queryCloudRegionReturnCode"), eq("404"))
+ Mockito.verify(mockExecution).setVariable(eq(Prefix + "aicCloudRegion"), eq("AAIAIC25"))
}
@Test
public void testPrepareVnfAdapterDeleteRequest() {
ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn("DDVMV_")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("aicCloudRegion")).thenReturn("RegionOne")
when(mockExecution.getVariable("tenantId")).thenReturn("12345")
@@ -139,8 +183,10 @@ class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
when(mockExecution.getVariable("volumeGroupId")).thenReturn("VolumeGroup123")
when(mockExecution.getVariable("DDVMV_aicCloudRegion")).thenReturn("Region1")
AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP,CLOUD_OWNER, "Region1","VolumeGroup123")
- Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/aai/VolumeGroupWithTenant.json");
+ Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/AAI/VolumeGroupWithTenant.json");
when(client.get(VolumeGroup.class,resourceUri)).thenReturn(volumeGroup)
+ when(client.get(resourceUri)).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/AAI/VolumeGroupWithTenant.json")))
deleteVfModuleVolumeV2.callRESTQueryAAIForVolumeGroup(mockExecution,"true")
Mockito.verify(mockExecution).setVariable("DDVMV_queryAAIVolGrpResponse", volumeGroup.get())
Mockito.verify(mockExecution).setVariable("DDVMV_volumeGroupHeatStackId", volumeGroup.get().getHeatStackId())
@@ -167,7 +213,7 @@ class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
when(mockExecution.getVariable("volumeGroupId")).thenReturn("VolumeGroup123")
when(mockExecution.getVariable("DDVMV_aicCloudRegion")).thenReturn("Region1")
AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP,CLOUD_OWNER, "Region1","VolumeGroup123")
- Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/aai/VolumeGroupWithTenant.json");
+ Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/AAI/VolumeGroupWithTenant.json");
when(client.get(VolumeGroup.class,resourceUri)).thenReturn(volumeGroup)
try {
deleteVfModuleVolumeV2.callRESTQueryAAIForVolumeGroup(mockExecution, "true")
@@ -248,30 +294,20 @@ class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
private ExecutionEntity setupMock() {
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DoDeleteVfModuleVolumeV2")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteVfModuleVolumeV2")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
+ mockRepositoryService = mock(RepositoryService.class)
ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
+ when(mockProcessEngineServices.getRepositoryService()).thenReturn(this.mockRepositoryService)
ExecutionEntity mockExecution = mock(ExecutionEntity.class)
// Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteVfModuleVolumeV2")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteVfModuleVolumeV2")
when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
return mockExecution
}
- private void mockData() {
- stubFor(get(urlMatching(".*/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/12345"))
+ private void mockSuccessfulCloudData() {
+ wireMockRule.stubFor(get(urlMatching(".*/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/12345"))
.willReturn(aResponse()
.withStatus(200).withHeader("Content-Type", "text/xml")
.withBodyFile("DoCreateVfModuleVolumeV2/cloudRegion_AAIResponse_Success.xml")))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
index 68a9ed659e..19bb7c86b4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -20,33 +22,34 @@
package org.onap.so.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkVpnBinding;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkTableReference;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkPolicy;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutNetworkIdWithDepth;
+import com.github.tomakehurst.wiremock.client.WireMock
+import com.github.tomakehurst.wiremock.junit.WireMockRule
import org.camunda.bpm.engine.ProcessEngineServices
import org.camunda.bpm.engine.RepositoryService
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
+import org.junit.*
import org.junit.runner.RunWith
import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
+import org.mockito.junit.MockitoJUnitRunner
+import org.onap.aai.domain.yang.*
import org.onap.so.bpmn.common.scripts.MsoUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.client.WireMock
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
+import org.onap.so.bpmn.mock.FileUtil
+import org.onap.so.client.aai.entities.AAIResultWrapper
+import org.springframework.mock.env.MockEnvironment
+
+import static org.mockito.ArgumentMatchers.eq
+import static org.mockito.ArgumentMatchers.isA
+import static org.mockito.ArgumentMatchers.refEq
+import static org.mockito.Mockito.atLeast
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.when
+import static org.onap.so.bpmn.mock.StubResponseAAI.*
@RunWith(MockitoJUnitRunner.class)
class DoUpdateNetworkInstanceTest {
@@ -200,24 +203,6 @@ String expectedNetworkInputMissingCloudRegion =
<sdncVersion>null</sdncVersion>
</network-inputs>"""
- String networkInputsMissingName =
- """<network-inputs xmlns="http://org.onap/so/infra/vnf-request/v1">
- <network-name/>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>"""
-
-String networkInputsMissingCloudRegion =
-"""<network-inputs xmlns="http://org.onap/so/infra/vnf-request/v1">
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region/>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
// expectedNetworkRequest
String expectedNetworkRequest =
"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
@@ -384,619 +369,6 @@ String expectedNetworkInputsMissingNetworkId =
</vnfreq:network-params>
</vnfreq:network-request>"""
- // expectedNetworkRequest
- String expectedNetworkRequest_Outputs =
- """<vnfreq:network-request xmlns:vnfreq="http://org.onap/so/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>UPDATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- </vnfreq:network-inputs>
- <vnfreq:network-outputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
- </vnfreq:network-outputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
-
- String networkInputs =
- """<network-inputs xmlns="http://org.onap/so/infra/vnf-request/v1">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
- String networkOutputs =
- """<network-outputs>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- </network-outputs>"""
-
- String queryAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-delete</orchestration-status>
- <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-update</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <subnet-role>ECOMP</subnet-role>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857300987</resource-version>
- </host-route>
- <host-route>
- <host-route-id>6f038013-8b15-4eb8-914b-507489fbc8ee</host-route-id>
- <route-prefix>10.102.0.0/16</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301151</resource-version>
- </host-route>
- <host-route>
- <host-route-id>8811c5f8-f1ed-4fa0-a505-e1be60396e28</host-route-id>
- <route-prefix>192.168.2.0/25</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <resource-version>1505857300987</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponseTestScenario01 =
- """<?xml version="1.0" encoding="UTF-8"?>
-<l3-network xmlns="http://org.openecomp.aai.inventory/v7">
- <network-id>4da55fe4-7a9e-478c-a434-8a98d62265ab</network-id>
- <network-name>GN_EVPN_direct_net_0_ST1</network-name>
- <network-type>CONTRAIL30_BASIC</network-type>
- <network-role>GN_EVPN_direct</network-role>
- <network-technology>contrail</network-technology>
- <is-bound-to-vpn>false</is-bound-to-vpn>
- <service-id>9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>1465398611</resource-version>
- <orchestration-status>pending-delete</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>cb1a7b47-5428-44c9-89c2-8b17541c3228</subnet-id>
- <gateway-address>108.239.40.1</gateway-address>
- <network-start-address>108.239.40.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>108.239.40.0</dhcp-start>
- <dhcp-end>108.239.40.0</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- <subnet>
- <subnet-id>e2cc7c14-90f0-4205-840d-b4e07f04e621</subnet-id>
- <gateway-address>2606:ae00:2e01:604::1</gateway-address>
- <network-start-address>2606:ae00:2e01:604::</network-start-address>
- <cidr-mask>64</cidr-mask>
- <ip-version>6</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>2606:ae00:2e01:604::</dhcp-start>
- <dhcp-end>2606:ae00:2e01:604::</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- </subnets>
- <ctag-assignments />
- <segmentation-assignments>
- <segmentation-id>416</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>cloud-region</related-to>
- <related-link>https://localhost:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/
- </related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>CloudOwner</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>cloud-region.owner-defined-type</property-key>
- <property-value></property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://localhost:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/tenants/tenant/4ae1d3446a4c48b2bec44b6cfba06d68/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>4ae1d3446a4c48b2bec44b6cfba06d68
- </relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>CloudOwner</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>Ruchira Contrail 3.0 test</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://localhost:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>9a7b327d9-287aa00-82c4b0-100001</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>GN_EVPN_direct_net_0_ST1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
- String queryIdAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list/>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryNameAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String queryNameAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String aaiVpnResponseStub =
- """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- xmlns="http://org.openecomp.aai.inventory/v8"
- contentType="text/xml">
- <vpn-binding>
- <global-route-target/>
- </vpn-binding>
-</rest:payload>"""
-
- String queryVpnBindingAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="localhost-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <vpn-binding xmlns="http://org.openecomp.aai.inventory/v6">
- <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
- <vpn-name>GN_EVPN_Test</vpn-name>
- <global-route-target>13979:105757</global-route-target>
- <relationship-list>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </vpn-binding>
- </rest:payload>
-</rest:RESTResponse>"""
-
String updateNetworkRequest =
"""<updateNetworkRequest>
@@ -1172,271 +544,10 @@ String updateNetworkRequest_noPhysicalName =
</networkRollback>
</rollbackNetworkRequest>"""
- String updateNetworkResponse =
- """<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.onap.so/network"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkStackId>
- <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
- <subnetIdMap>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- </subnetIdMap>
- <rollback>
- <cloudId>RDM2WAGPLCP</cloudId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- <networkUpdated>true</networkUpdated>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkUpdated>false</networkUpdated>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- </rollback>
-</ns2:updateNetworkContrailResponse>"""
-
- String updateContrailAAIPayloadRequest =
- """<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>Active</orchestration-status>
- <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
- <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-role>ECOMP</subnet-role>
- <resource-version>1505857300987</resource-version>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857300987</resource-version>
- </host-route>
- <host-route>
- <host-route-id>6f038013-8b15-4eb8-914b-507489fbc8ee</host-route-id>
- <route-prefix>10.102.0.0/16</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301151</resource-version>
- </host-route>
- <host-route>
- <host-route-id>8811c5f8-f1ed-4fa0-a505-e1be60396e28</host-route-id>
- <route-prefix>192.168.2.0/25</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type/>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
-
- String updateContrailAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Content-Length" value="0"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
-</rest:RESTResponse>"""
-
- String updateNetworkErrorResponse =
- """<updateNetworkError>
- <messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
- <message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
- <rolledBack>true</rolledBack>
- </updateNetworkError>"""
-
String networkException500 =
"""<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"http://org.onap.so/network", the namespace on the "updateNetworkContrail" element, is not a valid SOAP version.</faultstring></soap:Fault></soap:Body></soap:Envelope>"""
- String aaiResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="localhost-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>MNS-25180-L-01-dmz_direct_net_1/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
String changeAssignSDNCRequest =
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns5="http://org.onap/so/request/types/v1"
@@ -1465,8 +576,8 @@ String updateNetworkRequest_noPhysicalName =
</service-information>
<network-request-information>
<network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL30_BASIC</network-type>
+ <network-name>vprobes_pktinternal_net_4_1806</network-name>
<tenant>7dd5365547234ee8937416c65507d266</tenant>
<aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
</network-request-information>
@@ -1545,42 +656,6 @@ String assignResponse =
</sdncadapterworkflow:response-data>
</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
- String expected_sdncAdapterWorkflowResponse_Error =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:vnf"
- xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
- xmlns:tag0="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xsi:type="xs:string">
- <output>
- <response-code>400</response-code>
- <response-message>Error writing to l3-netework</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterWorkflowFormattedResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
- <response-code>200</response-code>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
String rollbackSDNCRequest =
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
@@ -1649,6 +724,22 @@ String rollbackNetworkRequest =
// - - - - - - - -
+ @BeforeClass
+ static void initEnv() {
+ MockEnvironment mockEnvironment = mock(MockEnvironment.class)
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.version")).thenReturn("14")
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.namespace")).thenReturn("defaultTestNamespace")
+ when(mockEnvironment.getProperty("aai.endpoint")).thenReturn("http://localhost:8090")
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(mockEnvironment)
+ }
+
+ @AfterClass
+ static void cleanupEnv() {
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(null)
+ }
+
@Before
public void init()
{
@@ -1743,117 +834,126 @@ String rollbackNetworkRequest =
}
- @Test
- //@Ignore
- public void preProcessRequest_NetworkRequest() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.rollback")).thenReturn("true")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
-
-// verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- // Authentications
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputs)
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_vPERNetworkRequest() {
-
- String networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
+ @Test
+ public void preProcessRequest_NetworkRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso.adapters.po.auth")).
+ thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C")
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ // Authentications
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputs)
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", """<network-outputs>
+\t <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+\t <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+\t </network-outputs>""")
+ verify(mockExecution).setVariable(Prefix + "networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ verify(mockExecution).setVariable(Prefix + "networkName", "MNS-25180-L-01-dmz_direct_net_1")
+ }
+
+ @Test
+ public void preProcessRequest_vPERNetworkRequest() {
+
+ String networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
"modelName": "CONTRAIL_EXTERNAL",
- "modelType": "CONTRAIL_EXTERNAL",
- "modelVersion": "1",
- "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
- "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
- }""".trim()
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") // optional
- when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
- when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
- when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
- when(mockExecution.getVariable("failIfExists")).thenReturn("false")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("action")).thenReturn("UPDATE")
- when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
- when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("mso.rollback")).thenReturn("true")
- when(mockExecution.getVariable("mso.adapters.sdnc.endpoint")).thenReturn("http://localhost:8090/SDNCAdapter")
- when(mockExecution.getVariable("mso.adapters.network.rest.endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("mso.adapters.sdnc.resource.endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
-
-// verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- // Authentications
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVperNetworkInputs)
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- }
-
- @Test
+ "modelType": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
+ "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
+ }""".trim()
+
+ println "************ preProcessRequest_Payload ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("action")).thenReturn("UPDATE")
+
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") // optional
+ when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
+ when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
+ when(mockExecution.getVariable("failIfExists")).thenReturn("false")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+
+ when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
+ when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ when(mockExecution.getVariable("mso.adapters.po.auth")).
+ thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C")
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ when(mockExecution.getVariable("mso.rollback")).thenReturn("true")
+ when(mockExecution.getVariable("mso.adapters.sdnc.endpoint")).
+ thenReturn("http://localhost:8090/SDNCAdapter")
+ when(mockExecution.getVariable("mso.adapters.network.rest.endpoint")).
+ thenReturn("http://localhost:8090/networks/NetworkAdapter")
+ when(mockExecution.getVariable("mso.adapters.sdnc.resource.endpoint")).
+ thenReturn("http://localhost:8090/SDNCAdapterRpc")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ // Authentications
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVperNetworkInputs)
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ verify(mockExecution).setVariable(eq(Prefix + "networkOutputs"), eq("""<network-outputs>
+\t <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+\t <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+\t </network-outputs>"""))
+
+ verify(mockExecution).setVariable(Prefix + "networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ verify(mockExecution).setVariable(Prefix + "networkName", "MNS-25180-L-01-dmz_direct_net_1")
+ }
+
+ @Test
//@Ignore
public void preProcessRequest_MissingNetworkId() {
@@ -1968,107 +1068,88 @@ String rollbackNetworkRequest =
}
- @Test
- //@Ignore
- public void prepareUpdateNetworkRequest() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareUpdateNetworkRequest_NoPhysicalname() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(NetworkRequest_noPhysicalName)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest_noPhysicalName)
-
- }
-
- @Test
- //@Ignore
- public void prepareSDNCRequest() {
-
- println "************ prepareSDNCRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(aaiResponse)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", changeAssignSDNCRequest)
-
- }
+ @Test
+ public void prepareUpdateNetworkRequest() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(getContrailL3Network())
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ when(mockExecution.getVariable(Prefix + "routeCollection")).
+ thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).
+ thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).
+ thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest)
+ }
+
+
+ @Test
+ public void prepareUpdateNetworkRequest_NoPhysicalname() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(NetworkRequest_noPhysicalName)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).
+ thenReturn(getContrailL3Network())
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest_noPhysicalName)
+ }
+
+ @Test
+ public void prepareSDNCRequest() {
+
+ println "************ prepareSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn(
+ "https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", changeAssignSDNCRequest)
+ }
@Test
//@Ignore
@@ -2101,614 +1182,412 @@ String rollbackNetworkRequest =
}
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkId_200() {
+ @Test
+ public void callRESTQueryAAINetworkId_200() {
+
+ println "************ callRESTQueryAAINetworkId ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4",
+ "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200")
+ verify(mockExecution).setVariable(eq(Prefix + "queryIdAAIResponse"), isA(AAIResultWrapper.class))
+ }
+
+ @Test
+ public void callRESTQueryAAICloudRegion30_200() {
+
+ println "************ callRESTQueryAAICloudRegion30_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion(wireMockRule, "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
+ when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).
+ thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ }
+
+ @Test
+ public void callRESTQueryAAICloudRegion25_200() {
- println "************ callRESTQueryAAINetworkId ************* "
+ println "************ callRESTQueryAAICloudRegion25_200 ************* "
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
+ WireMock.reset();
+ MockGetNetworkCloudRegion(wireMockRule, "CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
+ when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).
+ thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200")
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ }
- }
+ @Test
+ public void callRESTQueryAAICloudRegion_NotFound() {
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion30_200() {
+ println "************ callRESTQueryAAICloudRegionFake ************* "
- println "************ callRESTQueryAAICloudRegion30_200 ************* "
+ WireMock.reset();
+ MockGetNetworkCloudRegion_404(wireMockRule, "MDTWNJ21");
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
+ when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
+ when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).
+ thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ }
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ @Test
+ public void callRESTQueryAAINetworkVpnBinding_200() {
- }
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
- @Test
- public void callRESTQueryAAICloudRegion25_200() {
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAIResponseEmptyUri.json")))
- println "************ callRESTQueryAAICloudRegion25_200 ************* "
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse",
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="defaultTestNamespacev14"\n contentType="text/xml">\n <vpn-binding>
+ <global-route-target/>\n </vpn-binding>\n</rest:payload>""")
+ verify(mockExecution).setVariable(Prefix + "routeCollection", "<routeTargets/>")
+ }
+
+ @Test
+ public void callRESTQueryAAINetworkVpnBindingList_200() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ WireMock.reset();
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion_NotFound() {
-
- println "************ callRESTQueryAAICloudRegionFake ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion_404("MDTWNJ21");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
+ MockGetNetworkVpnBindingWithDepth(wireMockRule,
+ "BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json",
+ "13e94b71-3ce1-4988-ab0e-61208fc91f1c", "2")
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200() {
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "routeCollection", """<routeTargets>
+ <routeTarget>2001:051111</routeTarget>\n <routeTargetRole>EXPORT</routeTargetRole>\n</routeTargets>
+<routeTargets>\n <routeTarget>1000:051113</routeTarget>\n <routeTargetRole>IMPORT</routeTargetRole>\n</routeTargets>\n""")
+ }
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ @Test
+ public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ WireMock.reset();
+ MockGetNetworkVpnBindingWithDepth(wireMockRule,
+ "BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json",
+ "13e94b71-3ce1-4988-ab0e-61208fc91f1c", "2");
- }
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBindingList_200() {
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "routeCollection",
+ """<routeTargets>\n <routeTarget>2001:051111</routeTarget>\n <routeTargetRole>EXPORT</routeTargetRole>
+</routeTargets>\n<routeTargets>\n <routeTarget>1000:051113</routeTarget>\n <routeTargetRole>IMPORT</routeTargetRole>
+</routeTargets>\n""")
+ }
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ @Test
+ public void callRESTQueryAAINetworkVpnBinding_NotPresent() {
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ WireMock.reset();
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ MockGetNetworkVpnBindingWithDepth(wireMockRule,
+ "BuildingBlocks/Network/queryAAIVpnBindingTestResponse.json",
+ "13e94b71-3ce1-4988-ab0e-61208fc91f1c", "2")
- }
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() {
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "routeCollection", "")
+ }
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseTestScenario01)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ @Test
+ public void callRESTQueryAAINetworkTableRef_200() {
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ println "************ callRESTQueryAAINetworkTableRef_200 ************* "
+ WireMock.reset();
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 1)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- }
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 0)
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIResponse",
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="defaultTestNamespacev14"\n contentType="text/xml">\n <route-table-references>
+ <route-table-reference-fqdn/>\n </route-table-references>\n</rest:payload>""")
+ verify(mockExecution).setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>")
+ }
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ @Test
+ public void callRESTQueryAAINetworkPolicy_200() {
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ println "************ callRESTQueryAAINetworkPolicy_200 ************* "
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ WireMock.reset();
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 0)
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIResponse",
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="defaultTestNamespacev14"\n contentType="text/xml">\n <network-policy>
+ <network-policy-fqdn/>\n </network-policy>\n</rest:payload>""")
+ verify(mockExecution).setVariable(Prefix + "networkCollection", "<policyFqdns/>")
+ }
- }
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_NotPresent() {
+ @Test
+ public void callRESTReQueryAAINetworkId_200() {
- println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
+ println "************ callRESTReQueryAAINetworkId ************* "
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4",
+ "BuildingBlocks/Network/queryAAINetworkTestResponse.json", "1");
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseVpnNotPresent)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.l3-network.uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200")
+ verify(mockExecution).setVariable(eq(Prefix + "requeryIdAAIResponse"), isA(AAIResultWrapper.class))
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", """<network-outputs>
+ <network-id>467e3349-bec1-4922-bcb1-d0bb041bce30</network-id>
+ <network-name>vprobes_pktinternal_net_4_1806</network-name>
+ </network-outputs>""")
+ }
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", aaiVpnResponseStub)
+ @Test
+ public void callRESTUpdateContrailAAINetworkREST_200() {
- }
+ println "************ callRESTUpdateContrailAAINetwork ************* "
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkTableRef_200() {
+ WireMock.reset();
+ MockPostNetwork(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ MockPostNetworkSubnet(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "209f62cf-cf0c-42f8-b13c-f038b92ef108")
+ MockPostNetworkSubnet(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "971bc608-1aff-47c0-923d-92e43b699f01")
- println "************ callRESTQueryAAINetworkTableRef_200 ************* "
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAIResponseEmptyUri.json")))
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "isPONR", true)
+ }
- WireMock.reset();
- MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
- MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.default.aai.network-table-reference.uri")).thenReturn("")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.route-table-reference.uri")).thenReturn("/aai/v8/network/route-table-references/route-table-reference")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ @Test
+ public void validateUpdateNetworkResponseREST() {
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
+ println "************ validateNetworkResponse ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", updateNetworkResponseREST)
+ verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", updateRollbackNetworkRequest)
+ }
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ @Test
+ public void validateUpdateNetworkResponseREST_Error() {
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 2)
- verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", ['/aai/v8/network/route-table-references/route-table-reference/refFQDN1','/aai/v8/network/route-table-references/route-table-reference/refFQDN2'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest", "http://localhost:8090/aai/v8/network/route-table-references/route-table-reference/refFQDN1?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
+ println "************ validateNetworkResponse ************* "
- }
+ WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkPolicy_200() {
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(networkException500)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
- println "************ callRESTQueryAAINetworkPolicy_200 ************* "
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
- WireMock.reset();
- MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(1)).setVariable(eq("WorkflowException"), refEq(workflowException))
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.network-policy.uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ }
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
+ @Test
+ public void validateSDNCResponse() {
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ println "************ validateSDNCResponse ************* "
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 1)
- verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", ['/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest", "http://localhost:8090/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "sdncResponseSuccess")).thenReturn(true)
- }
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+ verify(mockExecution).setVariable(Prefix + "sdncRequestDataResponseCode", "200")
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", true)
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCResponse", sdncAdapterWorkflowResponse)
+ verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+ }
+
+ @Test(expected = BpmnError.class)
+ public void validateSDNCResponse_Error() {
-
- @Test
- //@Ignore
- public void callRESTReQueryAAINetworkId_200() {
-
- println "************ callRESTReQueryAAINetworkId ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200")
-
- }
-
-
- @Test
- //@Ignore
- public void callRESTUpdateContrailAAINetworkREST_200() {
-
- println "************ callRESTUpdateContrailAAINetwork ************* "
-
- WireMock.reset();
- MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest)
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
- verify(mockExecution).setVariable(Prefix + "isPONR", true)
-
- }
-
-
-
- @Test
- //@Ignore
- public void validateUpdateNetworkResponseREST() {
-
- println "************ validateNetworkResponse ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
-
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", updateNetworkResponseREST)
- verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", updateRollbackNetworkRequest)
-
- }
-
- @Test
- //@Ignore
- public void validateUpdateNetworkResponseREST_Error() {
-
- println "************ validateNetworkResponse ************* "
-
- WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(networkException500)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(1)).setVariable("WorkflowException", refEq(workflowException, any(WorkflowException.class)))
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse() {
-
- println "************ validateSDNCResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
- verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
-
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse_Error() {
-
- println "************ validateSDNCResponse ************* "
- //ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
- } catch (Exception ex) {
- println " Graceful Exit! - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- //verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void prepareRollbackData() {
-
- println "************ prepareRollbackData() ************* "
-
-
-
- WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareRollbackData(mockExecution)
-
-// verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
+ println "************ validateSDNCResponse ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
+ } catch (BpmnError ex) {
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+ println " Graceful Exit! - " + ex.getMessage()
+ throw ex
+ }
+ }
+
+ @Test
+ public void prepareRollbackData() {
+
+ println "************ prepareRollbackData() ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareRollbackData(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ }
@Test
//@Ignore
@@ -2735,6 +1614,37 @@ String rollbackNetworkRequest =
}
+ private static L3Network getContrailL3Network() {
+
+ HostRoutes routes1 = new HostRoutes()
+ routes1.getHostRoute().add(new HostRoute(routePrefix: "172.20.1.0/24", nextHop: "10.102.200.1"))
+ routes1.getHostRoute().add(new HostRoute(routePrefix: "10.102.0.0/16", nextHop: "10.102.200.1"))
+ routes1.getHostRoute().add(new HostRoute(routePrefix: "192.168.2.0/25", nextHop: "10.102.200.1"))
+
+ Subnet subnet1 = new Subnet(networkStartAddress: "107.239.52.0", cidrMask: "24", dhcpEnabled: true,
+ gatewayAddress: "107.239.52.1", ipVersion: "4", subnetId: "57e9a1ff-d14f-4071-a828-b19ae98eb2fc",
+ subnetName: "subnetName", ipAssignmentDirection: "true", hostRoutes: routes1)
+ Subnets subnets = new Subnets()
+ subnets.getSubnet().add(subnet1)
+
+ SegmentationAssignments segments = new SegmentationAssignments()
+ segments.getSegmentationAssignment().add(new SegmentationAssignment(segmentationId: "414"))
+ segments.getSegmentationAssignment().add(new SegmentationAssignment(segmentationId: "415"))
+
+ return new L3Network(
+ networkName: "MNS-25180-L-01-dmz_direct_net_1",
+ networkType: "CONTRAIL_EXTERNAL",
+ networkTechnology: "Contrail",
+ networkId: "49c86598-f766-46f8-84f8-8d1c1b10f9b4",
+ orchestrationStatus: "pending-create",
+ physicalNetworkName: "networkName",
+ heatStackId: "ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326",
+ isSharedNetwork: true,
+ subnets: subnets,
+ segmentationAssignments: segments
+ )
+ }
+
private ExecutionEntity setupMock() {
ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
@@ -2742,16 +1652,13 @@ String rollbackNetworkRequest =
RepositoryService mockRepositoryService = mock(RepositoryService.class)
when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
ExecutionEntity mockExecution = mock(ExecutionEntity.class)
// Initialize prerequisite variables
- when(mockExecution.getId()).thenReturn("100")
when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstance")
when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy
index 8af15de75b..80e2c863e8 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy
@@ -4,7 +4,9 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -32,7 +34,7 @@ import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.Captor
import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
+import org.mockito.junit.MockitoJUnitRunner
import org.onap.aai.domain.yang.GenericVnf
import org.onap.aai.domain.yang.VfModule
import org.onap.aai.domain.yang.VolumeGroup
@@ -48,23 +50,23 @@ import javax.ws.rs.core.UriBuilder
import static org.mockito.Mockito.*
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.Silent.class)
class UpdateVfModuleVolumeInfraV1Test extends MsoGroovyTest{
-
+
def prefix = "UPDVfModVol_"
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
@Rule
public ExpectedException thrown = ExpectedException.none()
-
- @Before
- public void init(){
+
+ @Before
+ public void init() {
super.init("UpdateVfModuleVolumeInfraV1")
- MockitoAnnotations.initMocks(this)
+ MockitoAnnotations.initMocks(this)
}
-
+
@Test
void testQueryAAIForVfModule() {
ExecutionEntity mockExecution = setupMock()
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
index 01f37ad655..ddcc6fe875 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
@@ -30,7 +30,11 @@ import com.googlecode.junittoolbox.WildcardPatternSuite;
@RunWith(WildcardPatternSuite.class)
@SuiteClasses({"!**/service/*Test.class", "!**/subprocess/*Test.class", "!**/process/*Test.class",
"!**/tasks/*Test.class", "!**/infrastructure/aai/*Test.class",
- "!**/infrastructure/scripts/*Test.class", "**/*Test.class"})
+ "!**/infrastructure/scripts/*Test.class",
+ "**/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.class",
+ "**/infrastructure/scripts/DoUpdateNetworkInstanceTest.class",
+ "**/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.class",
+ "**/*Test.class"})
public class AllTestsTestSuite {
// the class remains empty,
// used only as a holder for the above annotations
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json
new file mode 100644
index 0000000000..4a30d4bcec
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json
@@ -0,0 +1,903 @@
+{
+ "vpn-id": "13e94b71-3ce1-4988-ab0e-61208fc91f1c",
+ "vpn-name": "vMDNS",
+ "resource-version": "1510956324462",
+ "route-targets": {"route-target": [
+ {
+ "global-route-target": "2001:051111",
+ "route-target-role": "EXPORT",
+ "resource-version": "1515683690360"
+ },
+ {
+ "global-route-target": "1000:051113",
+ "route-target-role": "IMPORT",
+ "resource-version": "1515683690372"
+ }
+ ]},
+ "relationship-list": {"relationship": [
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/b3376949-5487-4a74-9029-332c07720c07",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "b3376949-5487-4a74-9029-332c07720c07"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_hsl_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/d0b8ecd3-aee4-48ba-8bc5-222d3fb08162",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "d0b8ecd3-aee4-48ba-8bc5-222d3fb08162"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/34305bd0-ad54-4349-8567-6f65ea09e750",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "34305bd0-ad54-4349-8567-6f65ea09e750"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vEPDG-FN_swu_direct_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/dfa4972a-ed82-43cd-98be-ed73bb3406a9",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "dfa4972a-ed82-43cd-98be-ed73bb3406a9"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_EXN_INTERNET_NET_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/93556256-aa23-449d-a2fd-3a9c034f232a",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "93556256-aa23-449d-a2fd-3a9c034f232a"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_CORE-NSD-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/7ce01c3a-5998-4908-85f6-ab29bc507a92",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "7ce01c3a-5998-4908-85f6-ab29bc507a92"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKEN_CORE-NSD-TOAM0_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/016d3722-999b-4133-b4e6-8a1088bab664",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "016d3722-999b-4133-b4e6-8a1088bab664"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND-vepdg-FN-Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/80038196-9eae-452c-ad06-1f3fef1bef9f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "80038196-9eae-452c-ad06-1f3fef1bef9f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VPMS-FN-26071-T-BE-01_cdr_direct_net420"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f5f38447-dc62-4969-90a3-c60474f9c0ac",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f5f38447-dc62-4969-90a3-c60474f9c0ac"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_OAM_DIRECT_NET_3"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/58b374aa-01ca-4a39-99b9-889c2f7ae908",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "58b374aa-01ca-4a39-99b9-889c2f7ae908"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_OAM_MGMT_NET_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/efe0dfca-18e7-4992-a63a-041b9f8271e0",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "efe0dfca-18e7-4992-a63a-041b9f8271e0"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_APN-dns_int_apn_dns_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/dab7e704-6a6e-4c53-9a80-fb5857a43b6f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "dab7e704-6a6e-4c53-9a80-fb5857a43b6f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKEN_CORE-NSD-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/634653b3-9084-41d9-ad6a-40863a3d666f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "634653b3-9084-41d9-ad6a-40863a3d666f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-01A_int_fw_dns_trusted_net_5"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6117b35e-c029-4308-85e6-007c24014484",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6117b35e-c029-4308-85e6-007c24014484"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-D-T001_vprobes_int_mgmt_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/eb1ce51b-d10f-4b08-9166-345335b9f73b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "eb1ce51b-d10f-4b08-9166-345335b9f73b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_OAMP_NSD_ISBC0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/468f83be-4abb-4901-950b-e399b77a09a0",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "468f83be-4abb-4901-950b-e399b77a09a0"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_IRPR-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/103d17dc-6575-427c-a2c1-301493e08ec0",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "103d17dc-6575-427c-a2c1-301493e08ec0"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_segw_hsl_direct_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/305214f8-64be-4209-8a0d-10b6dfb77dd1",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "305214f8-64be-4209-8a0d-10b6dfb77dd1"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vMDS_FN_int_fw_dns_trusted_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/7989a6d2-ba10-4a5d-8f15-4520bc833090",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "7989a6d2-ba10-4a5d-8f15-4520bc833090"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02AShared_cor_direct_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f040ebf4-76ad-4b05-a766-1deec26549ae",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f040ebf4-76ad-4b05-a766-1deec26549ae"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_gn_untrusted_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/26d6038b-4b9e-4fe5-bcff-9af7586651cc",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "26d6038b-4b9e-4fe5-bcff-9af7586651cc"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-D-T001_vprobes_pktinternal_net_10"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/9e78d3f4-85b5-40b8-803e-c3a0ab6d6165",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "9e78d3f4-85b5-40b8-803e-c3a0ab6d6165"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_MNS_Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/a2de22f9-eb91-452e-aff5-e81a1a679ef6",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "a2de22f9-eb91-452e-aff5-e81a1a679ef6"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_GN_DIRECT_NET_01"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6d6b7254-72d2-4731-80d6-8e8375d959e9",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6d6b7254-72d2-4731-80d6-8e8375d959e9"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_VDBE-PED-DMZ0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/21819ac4-95c4-490f-ba7c-0ad92920f805",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "21819ac4-95c4-490f-ba7c-0ad92920f805"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_FN_int_pktinternal_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/98ff6827-320a-4b71-bd2b-df2bd20b6855",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "98ff6827-320a-4b71-bd2b-df2bd20b6855"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_oam_protected_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/e229ab86-279c-4505-a08a-91e373293e20",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "e229ab86-279c-4505-a08a-91e373293e20"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_OAM_DIRECT_NET_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/bb722f93-2d1a-42a5-bd11-57ad30ff1085",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "bb722f93-2d1a-42a5-bd11-57ad30ff1085"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_segw_hsl_direct_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0399443d-1fc6-42a6-934c-77030d751916",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0399443d-1fc6-42a6-934c-77030d751916"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VDBE-PED-DMZ0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/d259ec74-304d-4bd2-bbd6-93c201acba42",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "d259ec74-304d-4bd2-bbd6-93c201acba42"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A__vprobes_int_mgmt_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f69fb458-e2bd-4d0f-9a47-430d18cbebfd",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f69fb458-e2bd-4d0f-9a47-430d18cbebfd"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VPMS-FN-26071-T-BE-01_cdr_direct_net4"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0f18b91f-ee79-403b-a081-8c0a89650641",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0f18b91f-ee79-403b-a081-8c0a89650641"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VPMS-FN_int_pktinternal_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/90fdbbbb-42bb-41ff-9356-db245466a4fc",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "90fdbbbb-42bb-41ff-9356-db245466a4fc"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_oam_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0e66adce-d5dd-4968-bcb2-83f0281424db",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0e66adce-d5dd-4968-bcb2-83f0281424db"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKEN_VDBF-MIS-UDAT0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/db572383-dbd7-4d5e-93cb-8c7c1d209a90",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "db572383-dbd7-4d5e-93cb-8c7c1d209a90"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_TRST_VIF_ISBC0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/478b7f86-8544-48e5-95f1-568dfd18730d",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "478b7f86-8544-48e5-95f1-568dfd18730d"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_GN_DIRECT_NET_01"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0f725895-5224-4016-b49a-d9d016eaafff",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0f725895-5224-4016-b49a-d9d016eaafff"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_OAM_DIRECT_NET_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/9cd47b0c-ee58-46f0-9ec5-b4db504dd59b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "9cd47b0c-ee58-46f0-9ec5-b4db504dd59b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "MNS-FN-25180-T-01Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f95259c9-f5c6-4861-a9f4-b6eec199b33f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f95259c9-f5c6-4861-a9f4-b6eec199b33f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/caf98ee4-2496-4c92-a41c-b6a50efcc29f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "caf98ee4-2496-4c92-a41c-b6a50efcc29f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_MGM-CORE-NSD-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/754739cb-5371-4d5b-a02a-489587d17443",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "754739cb-5371-4d5b-a02a-489587d17443"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_OAM_DIRECT_NET_4"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8cd7add8-0cfc-4f65-bbf8-d0f25a0dbc70",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8cd7add8-0cfc-4f65-bbf8-d0f25a0dbc70"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VDBE-MIS-UDAT0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/7093921f-bed8-4866-bb3c-a2b8c376ca69",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "7093921f-bed8-4866-bb3c-a2b8c376ca69"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_VIRPR-TDAT0_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/691da8b2-805e-4dd1-aaf5-b0e37414c662",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "691da8b2-805e-4dd1-aaf5-b0e37414c662"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_int_pktmirror_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/00eaa0b3-90df-4b43-a850-9d30abb7fded",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "00eaa0b3-90df-4b43-a850-9d30abb7fded"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-01AShared_oam_protected_net_5"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6ba57200-c61a-46be-821b-88b3fa169b66",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6ba57200-c61a-46be-821b-88b3fa169b66"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_OAM_MGMT_NET_3"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8e32ec2c-47a1-4514-b21a-2806e23f0437",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8e32ec2c-47a1-4514-b21a-2806e23f0437"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKENb_VDBF-PSD-DMZ0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/a755ddd0-512a-444d-9f38-97b3eff70f85",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "a755ddd0-512a-444d-9f38-97b3eff70f85"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_UNTR_VSE_ISBC0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c7bde85d-1c12-467c-ae6f-57bdf5c1d380",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c7bde85d-1c12-467c-ae6f-57bdf5c1d380"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKENb_VDBF-PSD-DMZ0_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0933fcec-9e78-4045-a21a-8258e18cb78e",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0933fcec-9e78-4045-a21a-8258e18cb78e"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vdbe_oam_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6a26a729-d9ce-4619-a20e-38597205ba7d",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6a26a729-d9ce-4619-a20e-38597205ba7d"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_swu_direct_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c1a06665-518b-408b-bfe0-8f393204baf6",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c1a06665-518b-408b-bfe0-8f393204baf6"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_OAM_MGMT_NET_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/fb51398b-7622-4570-9bd6-e29c82621d44",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "fb51398b-7622-4570-9bd6-e29c82621d44"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_OAM_MGMT_NET_4"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/92072731-1c40-45c2-a218-5e75b713b312",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "92072731-1c40-45c2-a218-5e75b713b312"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_TRST_VIF_ISBC0_net_0001"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c6d94632-fd6b-4bfe-993e-377b0368476b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c6d94632-fd6b-4bfe-993e-377b0368476b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-01AShared_int_ha_net_5"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/84516ef3-e371-4039-908e-83cd2b55a4a1",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "84516ef3-e371-4039-908e-83cd2b55a4a1"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "VPMS-FN-26071-T-BE-01_vprobes_int_mgmt_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/2c4f3adc-1a45-4484-8fb6-9eeac99eb922",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "2c4f3adc-1a45-4484-8fb6-9eeac99eb922"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_VDBE-MIS-UDAT0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/1fea0624-dac2-4997-904d-34ca1bc12fa9",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "1fea0624-dac2-4997-904d-34ca1bc12fa9"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02AShared_cps_internal_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8ab98982-05b7-45b2-828d-648da3d6cc0f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8ab98982-05b7-45b2-828d-648da3d6cc0f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_swu_direct_fn_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c8934d59-24a8-41cc-af9d-2026ef261843",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c8934d59-24a8-41cc-af9d-2026ef261843"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_oam_protected_net_vrar_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c741fe5b-bf27-4ad9-b30d-20518e115495",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c741fe5b-bf27-4ad9-b30d-20518e115495"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_int_apn_dns_fn_net_PB_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8285fbae-ec25-44f7-ac52-89a968d45a2b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8285fbae-ec25-44f7-ac52-89a968d45a2b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-T2B_vEPDG-FN_swu_direct_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/65e6d4b0-0c96-4bfa-bdd6-2baa16df322a",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "65e6d4b0-0c96-4bfa-bdd6-2baa16df322a"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vEPDG-FN_gn_untrusted_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/38e51c7b-adc2-491a-a036-3189645b007c",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "38e51c7b-adc2-491a-a036-3189645b007c"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vprobes_pktinternal_net_2_1806"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/4d210b09-b6ce-41b3-95a6-5e4dffea9ca2",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "4d210b09-b6ce-41b3-95a6-5e4dffea9ca2"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vprobes_pktinternal_net_3_1806"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c5df1c57-3c85-4abc-973f-a1ffb13e391a",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c5df1c57-3c85-4abc-973f-a1ffb13e391a"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-T-IST-04AShared_untrusted_vDBE_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/467e3349-bec1-4922-bcb1-d0bb041bce30",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "467e3349-bec1-4922-bcb1-d0bb041bce30"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vprobes_pktinternal_net_4_1806"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/1596f4d2-66b5-4627-96f2-c26794154530",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "1596f4d2-66b5-4627-96f2-c26794154530"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-T-IST-04AShared_untrusted_vDBE_net_2"
+ }]
+ }
+ ]}
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
index fd6c228cba..f7d44c030b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
@@ -1,5 +1,6 @@
<deleteVolumeGroupRequest>
<cloudSiteId>null</cloudSiteId>
+ <cloudOwner>null</cloudOwner>
<tenantId>12345</tenantId>
<volumeGroupId>12345</volumeGroupId>
<volumeGroupStackId>null</volumeGroupStackId>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index dad84e53a9..279957ca1e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -28,6 +28,7 @@ import java.util.Optional;
import java.util.TreeSet;
import java.util.UUID;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.onap.so.bpmn.common.BuildingBlockExecution;
@@ -204,7 +205,8 @@ public class AAICreateTasks {
if (platform.getPlatformName() == null || "".equals(platform.getPlatformName())) {
logger.debug("PlatformName is null in input. Skipping create platform...");
} else {
- aaiVnfResources.createPlatformandConnectVnf(platform,vnf);
+ List<String> platforms = splitCDL(platform.getPlatformName());
+ platforms.stream().forEach(platformName -> aaiVnfResources.createPlatformandConnectVnf(new Platform(platformName),vnf));
}
}
} catch (Exception ex) {
@@ -213,6 +215,13 @@ public class AAICreateTasks {
}
+ public List<String> splitCDL(String str){
+ return Stream.of(str.split(","))
+ .map(String::trim)
+ .map (elem -> new String(elem))
+ .collect(Collectors.toList());
+ }
+
public void createLineOfBusiness(BuildingBlockExecution execution) {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
@@ -221,7 +230,8 @@ public class AAICreateTasks {
if (lineOfBusiness.getLineOfBusinessName() == null || "".equals(lineOfBusiness.getLineOfBusinessName())) {
logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
} else {
- aaiVnfResources.createLineOfBusinessandConnectVnf(lineOfBusiness,vnf);
+ List<String> lineOfBussinesses = splitCDL(lineOfBusiness.getLineOfBusinessName());
+ lineOfBussinesses.stream().forEach(lobName -> aaiVnfResources.createLineOfBusinessandConnectVnf(new LineOfBusiness(lobName),vnf));
}
}
} catch (Exception ex) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
index 59ff71ab0c..9e0c26ba20 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
@@ -2,6 +2,8 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Ericsson. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -85,8 +87,7 @@ public class MonitorVnfmCreateJobTask extends MonitorVnfmJobTask{
+ "Unable to retrieve OperationStatus";
LOGGER.error(message);
exceptionUtil.buildAndThrowWorkflowException(execution, 1206, message);
- }
- if (operationStatusOption.isPresent()) {
+ } else if (operationStatusOption != null && operationStatusOption.isPresent()) {
final OperationStateEnum operationStatus = operationStatusOption.get();
if (operationStatus != OperationStateEnum.COMPLETED) {
final String message = "Unable to instantiate jobId: "
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
index d0901eb689..8bbb6c7f46 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
@@ -267,7 +267,7 @@ public class TestDataSetup{
projectCounter++;
Project project = new Project();
- project.setProjectName("testProjectName" + projectCounter);
+ project.setProjectName("testProjectName1 , testProjectName2 , testProjectName3" + projectCounter);
return project;
}
@@ -485,11 +485,11 @@ public class TestDataSetup{
genericVnf.setIpv4OamAddress("10.222.22.2");
Platform platform = new Platform();
- platform.setPlatformName("testPlatformName");
+ platform.setPlatformName(" testPlatformName, testPlatformName2 , testPlatformName3 , testPlatformName4");
genericVnf.setPlatform(platform);
LineOfBusiness lob = new LineOfBusiness();
- lob.setLineOfBusinessName("testLineOfBusinessName");
+ lob.setLineOfBusinessName(" testLineOfBusinessName , testLineOfBusinessName2, testLineOfBusinessName3, testLineOfBusinessName4");
genericVnf.setLineOfBusiness(lob);
ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
index fcb95ca07e..5c1caccc2d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
@@ -20,6 +20,7 @@
package org.onap.so.bpmn.infrastructure.aai.tasks;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
@@ -31,6 +32,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.Arrays;
+import java.util.List;
import java.util.Optional;
import java.util.TreeSet;
@@ -43,6 +45,7 @@ import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
import org.mockito.InjectMocks;
+import org.mockito.Mockito;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
@@ -51,6 +54,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
@@ -61,6 +65,7 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
public class AAICreateTasksTest extends BaseTaskTest{
@@ -162,14 +167,41 @@ public class AAICreateTasksTest extends BaseTaskTest{
public void createPlatformTest() throws Exception {
doNothing().when(aaiVnfResources).createPlatformandConnectVnf(genericVnf.getPlatform(), genericVnf);
aaiCreateTasks.createPlatform(execution);
- verify(aaiVnfResources, times(1)).createPlatformandConnectVnf(genericVnf.getPlatform(), genericVnf);
+ ArgumentCaptor<Platform> platformCaptor = ArgumentCaptor.forClass(Platform.class);
+ ArgumentCaptor<GenericVnf> genericVnf = ArgumentCaptor.forClass(GenericVnf.class);
+ Mockito.verify(aaiVnfResources,times(4)).createPlatformandConnectVnf(platformCaptor.capture(),genericVnf.capture());
+
+ List<Platform> capturedPlatforms = platformCaptor.getAllValues();
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName".equals(item.getPlatformName())));
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName2".equals(item.getPlatformName())));
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName3".equals(item.getPlatformName())));
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName4".equals(item.getPlatformName())));
}
@Test
public void createLineOfBusinessTest() throws Exception {
doNothing().when(aaiVnfResources).createLineOfBusinessandConnectVnf(genericVnf.getLineOfBusiness(), genericVnf);
aaiCreateTasks.createLineOfBusiness(execution);
- verify(aaiVnfResources, times(1)).createLineOfBusinessandConnectVnf(genericVnf.getLineOfBusiness(), genericVnf);
+
+ ArgumentCaptor<LineOfBusiness> lobCaptor = ArgumentCaptor.forClass(LineOfBusiness.class);
+ ArgumentCaptor<GenericVnf> genericVnf = ArgumentCaptor.forClass(GenericVnf.class);
+ Mockito.verify(aaiVnfResources,times(4)).createLineOfBusinessandConnectVnf(lobCaptor.capture(),genericVnf.capture());
+
+ List<LineOfBusiness> capturedLOB = lobCaptor.getAllValues();
+ assertTrue(capturedLOB.stream().anyMatch(item -> "testLineOfBusinessName".equals(item.getLineOfBusinessName())));
+ assertTrue(capturedLOB.stream().anyMatch(item -> "testLineOfBusinessName2".equals(item.getLineOfBusinessName())));
+ assertTrue(capturedLOB.stream().anyMatch(item -> "testLineOfBusinessName3".equals(item.getLineOfBusinessName())));
+ assertTrue(capturedLOB.stream().anyMatch(item -> "testLineOfBusinessName4".equals(item.getLineOfBusinessName())));
+
+ }
+
+ @Test
+ public void splitCDL_Test() throws Exception {
+ List<String> strings = aaiCreateTasks.splitCDL("Test");
+ assertEquals(strings.get(0),"Test");
+
+ List<String> strings2 = aaiCreateTasks.splitCDL("");
+ assertEquals(strings2.get(0),"");
}
@Test
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
index 1807a0b95a..29485f2de8 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
@@ -95,6 +95,7 @@ public class AAIObjectType implements GraphInventoryObjectType, Serializable {
public static final AAIObjectType BULK_PROCESS = new AAIObjectType("/bulkprocess", "", "bulkprocess");
public static final AAIObjectType SINGLE_TRANSACTION = new AAIObjectType("/bulk/single-transaction", "", "single-transaction");
public static final AAIObjectType GENERIC_VNF = new AAIObjectType(AAINamespaceConstants.NETWORK, GenericVnf.class);
+ public static final AAIObjectType GENERIC_VNFS = new AAIObjectType(AAINamespaceConstants.NETWORK, "/generic-vnfs", "generic-vnfs");
public static final AAIObjectType VF_MODULE = new AAIObjectType(AAIObjectType.GENERIC_VNF.uriTemplate(), VfModule.class);
public static final AAIObjectType L3_NETWORK = new AAIObjectType(AAINamespaceConstants.NETWORK, L3Network.class);
public static final AAIObjectType NETWORK_POLICY = new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkPolicy.class);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
index b58a3cdddc..dba393dcd6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
@@ -85,6 +85,6 @@ public class WorkflowSpecificationsHandler {
throw validateException;
}
- return builder.buildResponse(HttpStatus.SC_ACCEPTED, "", jsonResponse, apiVersion);
+ return builder.buildResponse(HttpStatus.SC_OK, "", jsonResponse, apiVersion);
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java
index 695213bf20..0602f09796 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,44 +22,31 @@
package org.onap.so.apihandlerinfra.validation;
-import java.util.List;
-import java.util.Map;
-
import org.onap.so.exceptions.ValidationException;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.RequestParameters;
import com.google.common.base.Strings;
-public class CustomWorkflowValidation implements ValidationRule{
-
+public class CustomWorkflowValidation implements ValidationRule {
+
@Override
- public ValidationInformation validate(ValidationInformation info) throws ValidationException{
- RequestParameters requestParameters = info.getSir().getRequestDetails().getRequestParameters();
- CloudConfiguration cloudConfiguration = info.getSir().getRequestDetails ().getCloudConfiguration();
- String workflowUuid = info.getInstanceIdMap().get("workflowUuid");
-
+ public ValidationInformation validate(ValidationInformation info) throws ValidationException {
+ RequestParameters requestParameters = info.getSir().getRequestDetails().getRequestParameters();
+ CloudConfiguration cloudConfiguration = info.getSir().getRequestDetails().getCloudConfiguration();
+
if (cloudConfiguration == null) {
- throw new ValidationException ("cloudConfiguration");
- }else if (Strings.isNullOrEmpty((cloudConfiguration.getCloudOwner ()))) {
- throw new ValidationException ("cloudOwner");
- }else if (Strings.isNullOrEmpty((cloudConfiguration.getLcpCloudRegionId ()))) {
- throw new ValidationException ("lcpCloudRegionId");
- }else if (Strings.isNullOrEmpty((cloudConfiguration.getTenantId ()))) {
- throw new ValidationException ("tenantId");
- }
- if(requestParameters == null){
- throw new ValidationException("requestParameters");
- }
-
- List<Map<String, Object>> userParams = requestParameters.getUserParams();
- if (!validateCustomUserParams(userParams, workflowUuid)) {
- throw new ValidationException("userParams");
- }
- return info;
- }
-
- private boolean validateCustomUserParams(List<Map<String, Object>> userParams, String workflowUuid) {
- return true;
+ throw new ValidationException("cloudConfiguration");
+ } else if (Strings.isNullOrEmpty((cloudConfiguration.getCloudOwner()))) {
+ throw new ValidationException("cloudOwner");
+ } else if (Strings.isNullOrEmpty((cloudConfiguration.getLcpCloudRegionId()))) {
+ throw new ValidationException("lcpCloudRegionId");
+ } else if (Strings.isNullOrEmpty((cloudConfiguration.getTenantId()))) {
+ throw new ValidationException("tenantId");
+ }
+ if (requestParameters == null) {
+ throw new ValidationException("requestParameters");
+ }
+ return info;
}
-} \ No newline at end of file
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java
index 1a2eca6300..760532e6fe 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java
@@ -71,7 +71,7 @@ public class WorkflowSpecificationsHandlerTest extends BaseTest{
WorkflowSpecifications expectedResponse = mapper.readValue(new String(Files.readAllBytes(Paths.get("src/test/resources/__files/WorkflowSpecifications.json"))), WorkflowSpecifications.class);
- assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
WorkflowSpecifications realResponse = mapper.readValue(response.getBody(), WorkflowSpecifications.class);
assertThat(realResponse, sameBeanAs(expectedResponse));
assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0));