aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java19
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java2
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java32
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java2
-rw-r--r--adapters/mso-cnf-adapter/pom.xml4
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java66
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java87
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java63
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java (renamed from adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java)13
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java509
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java94
-rw-r--r--adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java62
-rw-r--r--adapters/mso-openstack-adapters/pom.xml2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java15
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java15
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy409
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java9
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java1
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java4
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java19
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java19
-rw-r--r--docs/api/swagger/swagger.html883
-rw-r--r--docs/developer_info/Mso_Openstack_Adapter.rst796
-rw-r--r--docs/developer_info/developer_information.rst1
-rw-r--r--docs/images/DeleteInventory.pngbin0 -> 23922 bytes
-rw-r--r--docs/images/InventoryAddAudit.pngbin0 -> 23291 bytes
-rw-r--r--docs/images/InventoryCreate.pngbin0 -> 23140 bytes
-rw-r--r--docs/images/InventoryDeleteAudit.pngbin0 -> 23275 bytes
-rw-r--r--docs/images/InventoryQueryAudit.pngbin0 -> 23456 bytes
-rw-r--r--docs/images/OpenstackAdapterInvoke.pngbin0 -> 25753 bytes
-rw-r--r--docs/images/OpenstackAdapterPoller.pngbin0 -> 26486 bytes
-rw-r--r--docs/images/OpenstackAdapterRollback.pngbin0 -> 25984 bytes
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json57
41 files changed, 3046 insertions, 289 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
index 59c6becfbd..fa5c57f447 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
@@ -89,4 +89,23 @@ public final class AuthenticationMethodFactory {
v3Auth.setScope(scope);
return v3Auth;
}
+
+ public final com.woorea.openstack.keystone.v3.model.Authentication getAuthenticationForV3(
+ CloudIdentity cloudIdentity) {
+ Identity identity = new Identity();
+ Password password = new Password();
+ User user = new User();
+ Domain userDomain = new Domain();
+ userDomain.setName(cloudIdentity.getUserDomainName());
+ user.setName(cloudIdentity.getMsoId());
+ user.setPassword(CryptoUtils.decryptCloudConfigPassword(cloudIdentity.getMsoPass()));
+ user.setDomain(userDomain);
+ password.setUser(user);
+ identity.setPassword(password);
+ identity.setMethods(Collections.singletonList("password"));
+ com.woorea.openstack.keystone.v3.model.Authentication v3Auth =
+ new com.woorea.openstack.keystone.v3.model.Authentication();
+ v3Auth.setIdentity(identity);
+ return v3Auth;
+ }
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
index 16906957a7..3564b8f0a7 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
@@ -107,7 +107,7 @@ public class KeystoneV3Authentication {
return policy;
}
- protected String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) {
+ public String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) {
for (Service service : serviceCatalog) {
if (type.equals(service.getType())) {
for (Service.Endpoint endpoint : service.getEndpoints()) {
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
index 63bc235363..072ab5a8d0 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
@@ -21,15 +21,29 @@
package org.onap.so.openstack.utils;
import java.util.Map;
+import org.onap.so.cloud.authentication.AuthenticationMethodFactory;
import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.openstack.beans.MsoTenant;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
+import org.onap.so.utils.CryptoUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import com.woorea.openstack.keystone.v3.model.Token;
+import com.woorea.openstack.base.client.OpenStackConnectException;
+import com.woorea.openstack.base.client.OpenStackResponseException;
+import com.woorea.openstack.keystone.v3.Keystone;
+import com.woorea.openstack.keystone.v3.api.TokensResource.Authenticate;
+import com.woorea.openstack.keystone.v3.model.Authentication;
+import com.woorea.openstack.keystone.v3.model.Authentication.Identity;
@Component
public class MsoKeystoneV3Utils extends MsoTenantUtils {
+ @Autowired
+ private AuthenticationMethodFactory authenticationMethodFactory;
+
@Override
public String createTenant(String tenantName, String cloudSiteId, Map<String, String> metadata, boolean backout)
throws MsoException {
@@ -57,4 +71,22 @@ public class MsoKeystoneV3Utils extends MsoTenantUtils {
return cloudIdentity.getIdentityUrl();
}
+ public Token getKeystoneToken(CloudSite cloudSite) throws MsoException {
+ try {
+ CloudIdentity cloudIdentity = cloudSite.getIdentityService();
+
+ Keystone keystone = new Keystone(cloudIdentity.getIdentityUrl());
+
+ Authentication auth = authenticationMethodFactory.getAuthenticationForV3(cloudIdentity);
+
+ Authenticate authenticate = keystone.tokens().authenticate(auth);
+ return executeAndRecordOpenstackRequest(authenticate);
+
+ } catch (OpenStackResponseException e) {
+ throw keystoneErrorToMsoException(e, "TokenAuth");
+ } catch (OpenStackConnectException e) {
+ throw keystoneErrorToMsoException(e, "TokenAuth");
+ }
+ }
+
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
index c5eeb34157..968e7864b3 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
@@ -49,4 +49,6 @@ public class NovaClient extends MsoCommonUtils {
novaClient.token(keystone.getId());
return novaClient;
}
+
+
}
diff --git a/adapters/mso-cnf-adapter/pom.xml b/adapters/mso-cnf-adapter/pom.xml
index fb25157a96..0928da084e 100644
--- a/adapters/mso-cnf-adapter/pom.xml
+++ b/adapters/mso-cnf-adapter/pom.xml
@@ -110,11 +110,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
- <!-- <dependency>
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
- </dependency> -->
+ </dependency>
<!-- <dependency>
<groupId>org.onap.so</groupId>
<artifactId>mso-requests-db</artifactId>
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java
new file mode 100644
index 0000000000..c950cf6b2a
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.cnf.exceptions;
+
+import static org.onap.so.adapters.cnf.util.CNfAdapterUtil.marshal;
+import org.onap.so.adapters.cnf.model.ErrorResponse;
+import org.springframework.http.ResponseEntity;
+
+public class ApplicationException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ private int errorCode;
+
+ private String errorMsg;
+
+ public ApplicationException(int errorCode, String errorMsg) {
+ this.errorCode = errorCode;
+ this.errorMsg = errorMsg;
+ }
+
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getErrorMsg() {
+ return errorMsg;
+ }
+
+ public void setErrorMsg(String errorMsg) {
+ this.errorMsg = errorMsg;
+ }
+
+ public ResponseEntity buildErrorResponse() {
+ String message;
+ try {
+ ErrorResponse err = new ErrorResponse(errorCode, errorMsg);
+ message = marshal(err);
+ } catch (ApplicationException e) {
+ return ResponseEntity.status(500).body("Internal Server Error");
+ }
+ return ResponseEntity.status(errorCode).body(message);
+ }
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java
new file mode 100644
index 0000000000..2e76d51da2
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java
@@ -0,0 +1,87 @@
+package org.onap.so.adapters.cnf.model;
+
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonIgnoreProperties(value = "true")
+public class BpmnInstanceRequest {
+
+ @JsonProperty(value = "modelInvariantId")
+ private String modelInvariantId;
+
+ @JsonProperty(value = "modelVersionId")
+ private String modelVersionId;
+
+ @JsonProperty(value = "k8sRBProfileName")
+ private String k8sRBProfileName;
+
+ @JsonProperty(value = "cloudRegionId")
+ private String cloudRegionId;
+
+ @JsonProperty(value = "vfModuleUUID")
+ private String vfModuleUUID;
+
+ @JsonProperty(value = "labels")
+ private Map<String, String> labels;
+
+ @JsonProperty(value = "overrideValues")
+ private Map<String, String> overrideValues;
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getK8sRBProfileName() {
+ return k8sRBProfileName;
+ }
+
+ public void setK8sRBProfileName(String k8sRBProfileName) {
+ this.k8sRBProfileName = k8sRBProfileName;
+ }
+
+ public String getCloudRegionId() {
+ return cloudRegionId;
+ }
+
+ public void setCloudRegionId(String cloudRegionId) {
+ this.cloudRegionId = cloudRegionId;
+ }
+
+ public String getVfModuleUUID() {
+ return vfModuleUUID;
+ }
+
+ public void setVfModuleUUID(String vfModuleUUID) {
+ this.vfModuleUUID = vfModuleUUID;
+ }
+
+ public Map<String, String> getLabels() {
+ return labels;
+ }
+
+ public void setLabels(Map<String, String> labels) {
+ this.labels = labels;
+ }
+
+ public Map<String, String> getOverrideValues() {
+ return overrideValues;
+ }
+
+ public void setOverrideValues(Map<String, String> overrideValues) {
+ this.overrideValues = overrideValues;
+ }
+
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java
new file mode 100644
index 0000000000..135adcc143
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.cnf.model;
+
+public class ErrorResponse {
+
+ private int status;
+
+ private String error;
+
+ private String message;
+
+ public ErrorResponse(int status, String message) {
+ this.status = status;
+ this.message = message;
+ this.error = "Bad Request";
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public String getError() {
+ if (status == 500) {
+ this.error = "Internal Server Error";
+ }
+ return error;
+ }
+
+ public void setError(String error) {
+ this.error = error;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
index 04f2f9d030..b1719cbd7d 100644
--- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(value = "true")
-public class InstanceEntity {
+public class MulticloudInstanceRequest {
@JsonProperty(value = "cloud-region")
private String cloudRegion;
@@ -25,6 +25,9 @@ public class InstanceEntity {
@JsonProperty(value = "override-values")
private Map<String, String> overrideValues;
+ @JsonProperty(value = "release-name")
+ private String vfModuleUuid;
+
public String getCloudRegion() {
return cloudRegion;
}
@@ -73,4 +76,12 @@ public class InstanceEntity {
this.overrideValues = overrideValues;
}
+ public String getVfModuleUuid() {
+ return vfModuleUuid;
+ }
+
+ public void setVfModuleUuid(String vfModuleUuid) {
+ this.vfModuleUuid = vfModuleUuid;
+ }
+
}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
index 952edef7f6..b6d50da557 100644
--- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
@@ -1,27 +1,39 @@
package org.onap.so.adapters.cnf.rest;
+import java.io.File;
+import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
+import org.onap.so.adapters.cnf.model.BpmnInstanceRequest;
import org.onap.so.adapters.cnf.model.ConfigTemplateEntity;
import org.onap.so.adapters.cnf.model.ConfigurationEntity;
+import org.onap.so.adapters.cnf.model.ConfigurationRollbackEntity;
import org.onap.so.adapters.cnf.model.ConnectivityInfo;
-import org.onap.so.adapters.cnf.model.InstanceEntity;
+import org.onap.so.adapters.cnf.model.MulticloudInstanceRequest;
import org.onap.so.adapters.cnf.model.ProfileEntity;
import org.onap.so.adapters.cnf.model.ResourceBundleEntity;
+import org.onap.so.adapters.cnf.model.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -32,14 +44,14 @@ public class CnfAdapterRest {
private final CloseableHttpClient httpClient = HttpClients.createDefault();
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/healthcheck"}, method = RequestMethod.GET,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/healthcheck"}, method = RequestMethod.GET,
produces = "application/json")
public String healthCheck() throws Exception {
logger.info("health check called.");
// TODO
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/healthcheck");
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/healthcheck");
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
return EntityUtils.toString(response.getEntity());
@@ -47,7 +59,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition"}, method = RequestMethod.POST,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition"}, method = RequestMethod.POST,
produces = "application/json")
public String createRB(@RequestBody ResourceBundleEntity rB) throws Exception {
@@ -55,7 +67,7 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition");
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition");
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
String requestBody = objectMapper.writeValueAsString(rB);
@@ -70,8 +82,8 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}"},
- method = RequestMethod.GET, produces = "application/json")
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}"}, method = RequestMethod.GET,
+ produces = "application/json")
public String getRB(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
throws Exception {
@@ -79,16 +91,101 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet(
- "https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/" + rbVersion);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion);
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteRB(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
+ throws Exception {
+
+ logger.info("delete RB called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getListOfRB(@PathVariable("rb-name") String rbName) throws Exception {
+
+ logger.info("getListOfRB called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getListOfRBWithoutUsingRBName() throws Exception {
+
+ logger.info("getListOfRBWithoutUsingRBName called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition");
+
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
return EntityUtils.toString(response.getEntity());
}
+
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/content"},
+ method = RequestMethod.POST, produces = "multipart/form-data")
+ public String uploadArtifactForRB(@RequestParam("file") MultipartFile file, @PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion) throws Exception {
+
+ logger.info("Upload Artifact For RB called.");
+
+ File convFile = new File(file.getOriginalFilename());
+ file.transferTo(convFile);
+ FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+ builder.addPart("file", fileBody);
+ HttpEntity entity = builder.build();
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post =
+ new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/content");
+ post.setHeader("Content-Type", "multipart/form-data");
+ logger.info(String.valueOf(post));
+ post.setEntity(entity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
method = RequestMethod.POST, produces = "application/json")
public String createProfile(@RequestBody ProfileEntity fE, @PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion) throws Exception {
@@ -97,8 +194,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("http://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/profile");
+ HttpPost post =
+ new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(fE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -112,7 +209,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
method = RequestMethod.GET, produces = "application/json")
public String getProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
@PathVariable("pr-name") String prName) throws Exception {
@@ -121,8 +218,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/profile/" + prName);
+ HttpGet req = new HttpGet(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile/" + prName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -131,18 +228,130 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/instance"}, method = RequestMethod.POST,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
+ method = RequestMethod.GET, produces = "application/json")
+ public String getListOfProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
+ throws Exception {
+
+ logger.info("getListOfProfile called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile");
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("pr-name") String prName) throws Exception {
+
+ logger.info("delete Profile called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile/" + prName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}/content"},
+ method = RequestMethod.POST, produces = "multipart/form-data")
+ public String uploadArtifactForProfile(@RequestParam("file") MultipartFile file,
+ @PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("pr-name") String prName) throws Exception {
+
+ logger.info("Upload Artifact For Profile called.");
+
+ File convFile = new File(file.getOriginalFilename());
+ file.transferTo(convFile);
+ FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+ builder.addPart("file", fileBody);
+ HttpEntity entity = builder.build();
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion
+ + "/profile/" + prName + "/content");
+ post.setHeader("Content-Type", "multipart/form-data");
+
+ logger.info(String.valueOf(post));
+ post.setEntity(entity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance"}, method = RequestMethod.POST,
produces = "application/json")
- public String createInstance(@RequestBody InstanceEntity iE) throws Exception {
+ public String createInstance(@RequestBody BpmnInstanceRequest bpmnInstanceRequest) throws Exception {
logger.info("create Instance called.");
+ MulticloudInstanceRequest multicloudInstanceRequest = new MulticloudInstanceRequest();
+
+ if (bpmnInstanceRequest.getK8sRBProfileName() != null) {
+ multicloudInstanceRequest.setCloudRegion(bpmnInstanceRequest.getCloudRegionId());
+ multicloudInstanceRequest.setLabels(bpmnInstanceRequest.getLabels());
+ multicloudInstanceRequest.setOverrideValues(bpmnInstanceRequest.getOverrideValues());
+ multicloudInstanceRequest.setProfileName(bpmnInstanceRequest.getK8sRBProfileName());
+ multicloudInstanceRequest.setRbName(bpmnInstanceRequest.getModelInvariantId());
+ multicloudInstanceRequest.setRbVersion(bpmnInstanceRequest.getModelVersionId());
+ multicloudInstanceRequest.setVfModuleUuid(bpmnInstanceRequest.getVfModuleUUID());
+ } else {
+
+ logger.info("K8sRBProfileName is required");
+ return "K8sRBProfileName is required";
+ }
+
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/instance");
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/instance");
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ String requestBody = objectMapper.writeValueAsString(multicloudInstanceRequest);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ // This api is not enabled in multicloud project ,but this is required in
+ // future.
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{vnfInstanceId}"}, method = RequestMethod.PUT,
+ produces = "application/json")
+ public String updateInstance(@RequestBody MulticloudInstanceRequest iE,
+ @PathVariable("vnfInstanceId") String instanceId) throws Exception {
+
+ logger.info("create Instance called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPut post = new HttpPut("http://172.17.0.2:31770/v1/instance/" + instanceId);
ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
String requestBody = objectMapper.writeValueAsString(iE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
post.setEntity(requestEntity);
@@ -155,14 +364,15 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/instance/{instID}"}, method = RequestMethod.GET,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}"}, method = RequestMethod.GET,
produces = "application/json")
public String getInstance(@PathVariable("instID") String instanceId) throws Exception {
logger.info("get Instance called.");
+
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/instance/" + instanceId);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance/" + instanceId);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -171,8 +381,62 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(
- value = {"/api/multicloud-k8s/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}/status"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getInstanceStatus(@PathVariable("instID") String instanceId) throws Exception {
+
+ logger.info("getInstanceStatus called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance/" + instanceId + "/status");
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getInstanceBasedOnRBNameOrRBVersionOrProfileName(
+ @RequestParam(value = "rb-name", required = false) String rbName,
+ @RequestParam(value = "rb-version", required = false) String rbVersion,
+ @RequestParam(value = "profile-name", required = false) String profileName) throws Exception {
+
+ logger.info("getInstanceBasedOnRBNameOrRBVersionOrProfileName called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance?rb-name=" + rbName + "&rb-version=" + rbVersion
+ + "&profile-name=" + profileName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}"}, method = RequestMethod.DELETE,
+ produces = "application/json")
+ public String deleteInstance(@PathVariable("instID") String instanceID) throws Exception {
+
+ logger.info("delete Instance called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/instance/" + instanceID);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config"},
method = RequestMethod.POST, produces = "application/json")
public String createConfiguration(@RequestBody ConfigurationEntity cE, @PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName)
@@ -182,8 +446,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/definition/" + rbName + "/"
- + rbVersion + "/profile/" + prName + "/config");
+ HttpPost post = new HttpPost(
+ "http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/" + prName + "/config");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(cE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -198,7 +462,7 @@ public class CnfAdapterRest {
@ResponseBody
@RequestMapping(value = {
- "/api/multicloud-k8s/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+ "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
method = RequestMethod.GET, produces = "application/json")
public String getConfiguration(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
@PathVariable("profile-name") String prName, @PathVariable("cfg-name") String cfgName) throws Exception {
@@ -207,8 +471,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/definition/" + rbName + "/"
- + rbVersion + "/profile/" + prName + "/config/" + cfgName);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/" + cfgName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -217,7 +481,79 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/connectivity-info"}, method = RequestMethod.POST,
+ @RequestMapping(value = {
+ "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteConfiguration(@PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName,
+ @PathVariable("cfg-name") String cfgName) throws Exception {
+
+ logger.info("delete Configuration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion
+ + "/profile/" + prName + "/config/" + cfgName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {
+ "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+ method = RequestMethod.PUT, produces = "application/json")
+ public String updateConfiguration(@RequestBody ConfigurationEntity cE, @PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName,
+ @PathVariable("cfg-name") String cfgName) throws Exception {
+
+ logger.info("update Configuration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPut post = new HttpPut("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/" + cfgName);
+ ObjectMapper objectMapper = new ObjectMapper();
+ String requestBody = objectMapper.writeValueAsString(cE);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/tagit"},
+ method = RequestMethod.POST, produces = "application/json")
+ public String tagConfigurationValue(@RequestBody Tag tag, @PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion, @PathVariable("pr-name") String prName) throws Exception {
+ logger.info("Tag Configuration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/tagit");
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ String requestBody = objectMapper.writeValueAsString(tag);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info"}, method = RequestMethod.POST,
produces = "application/json")
public String createConnectivityInfo(@RequestBody ConnectivityInfo cIE) throws Exception {
@@ -225,7 +561,7 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/connectivity-info");
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/connectivity-info");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(cIE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -239,7 +575,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.GET,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.GET,
produces = "application/json")
public String getConnectivityInfo(@PathVariable("connname") String connName) throws Exception {
@@ -247,7 +583,7 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/connectivity-info/" + connName);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/connectivity-info/" + connName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -256,7 +592,25 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.DELETE,
+ produces = "application/json")
+ public String deleteConnectivityInfo(@PathVariable("connname") String connName) throws Exception {
+
+ logger.info("delete Connectivity Info called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/connectivity-info/" + connName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template"},
method = RequestMethod.POST, produces = "application/json")
public String createConfigTemplate(@RequestBody ConfigTemplateEntity tE, @PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion) throws Exception {
@@ -265,8 +619,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("http://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/config-template");
+ HttpPost post = new HttpPost(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(tE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -280,7 +634,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
method = RequestMethod.GET, produces = "application/json")
public String getConfigTemplate(@PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion, @PathVariable("tname") String tName) throws Exception {
@@ -289,8 +643,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/config-template/" + tName);
+ HttpGet req = new HttpGet(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template/" + tName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -298,4 +652,83 @@ public class CnfAdapterRest {
}
}
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteTemplate(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("tname") String tName) throws Exception {
+
+ logger.info("deleteTemplate called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template/" + tName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(
+ value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}/content"},
+ method = RequestMethod.POST, produces = "multipart/form-data")
+ public String uploadTarFileForTemplate(@RequestParam("file") MultipartFile file,
+ @PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("tname") String tName) throws Exception {
+
+ logger.info("uploadTarFileForTemplate called.");
+
+ File convFile = new File(file.getOriginalFilename());
+ file.transferTo(convFile);
+ FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+ builder.addPart("file", fileBody);
+ HttpEntity entity = builder.build();
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion
+ + "/config-template/" + tName + "/content");
+ post.setHeader("Content-Type", "multipart/form-data");
+
+ logger.info(String.valueOf(post));
+ post.setEntity(entity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rbName}/{rbVersion}/profile/{prName}/config/rollback"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String rollbackConfiguration(@RequestBody ConfigurationRollbackEntity rE,
+ @PathVariable("rbName") String rbName, @PathVariable("rbVersion") String rbVersion,
+ @PathVariable("prName") String prName) throws Exception {
+ logger.info("rollbackConfiguration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/rollback");
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ String requestBody = objectMapper.writeValueAsString(rE);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java
new file mode 100644
index 0000000000..25e506c55e
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.cnf.util;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.onap.so.adapters.cnf.exceptions.ApplicationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.onap.logging.filter.base.ErrorCode;
+import static org.onap.so.logger.LoggingAnchor.THREE;
+import static org.onap.so.logger.MessageEnum.RA_NS_EXC;
+
+public class CNfAdapterUtil {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CNfAdapterUtil.class);
+
+ public static final int BAD_REQUEST = 400;
+
+ private static final String UNMARSHAL_FAIL_MSG = "Failed to unmarshal json";
+
+ private static final String MARSHAL_FAIL_MSG = "Failed to marshal object";
+
+ private static final ObjectMapper MAPPER = new ObjectMapper();
+
+ public static class StatusDesc {
+
+ public static final String ALLOCATE_NSS_SUCCESS = "Allocating nss is " + "successful";
+
+ public static final String CREATE_NSS_SUCCESS = "Creating nss is " + "successful";
+
+ public static final String DEALLOCATE_NSS_SUCCESS = "Deallocate nss " + "is successful";
+
+ public static final String ACTIVATE_NSS_SUCCESS = "Activate nss " + "is successful";
+
+ public static final String DEACTIVATE_NSS_SUCCESS = "Deactivate nss " + "is successful";
+
+ public static final String QUERY_JOB_STATUS_FAILED = "Query job " + "status failed";
+
+ public static final String QUERY_JOB_STATUS_SUCCESS = "Query job " + "status is successful";
+
+ private StatusDesc() {
+
+ }
+ }
+
+ private CNfAdapterUtil() {
+
+ }
+
+ public static void assertObjectNotNull(Object object) throws ApplicationException {
+ if (null == object) {
+ LOGGER.error("Object is null.");
+ throw new ApplicationException(BAD_REQUEST, "An object is null.");
+ }
+ }
+
+ public static <T> T unMarshal(String jsonstr, Class<T> type) throws ApplicationException {
+ try {
+ return MAPPER.readValue(jsonstr, type);
+ } catch (IOException e) {
+ LOGGER.error(THREE, RA_NS_EXC.toString(), ErrorCode.BusinessProcessError.getValue(), UNMARSHAL_FAIL_MSG, e);
+ throw new ApplicationException(BAD_REQUEST, UNMARSHAL_FAIL_MSG);
+ }
+ }
+
+ public static String marshal(Object srcObj) throws ApplicationException {
+ try {
+ return MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(srcObj);
+ } catch (IOException e) {
+ LOGGER.error(THREE, RA_NS_EXC.toString(), ErrorCode.BusinessProcessError.getValue(), MARSHAL_FAIL_MSG, e);
+ throw new ApplicationException(BAD_REQUEST, MARSHAL_FAIL_MSG);
+ }
+ }
+
+}
diff --git a/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java b/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java
new file mode 100644
index 0000000000..38a10918bc
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.cnf;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.onap.so.adapters.cnf.model.BpmnInstanceRequest;
+import org.onap.so.adapters.cnf.rest.CnfAdapterRest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+public class CnfAdapterRestTest {
+
+ @InjectMocks
+ CnfAdapterRest cnfAdapterRest;
+
+ @Test
+ public void createInstanceTest() throws Exception {
+
+ Map<String, String> labels = new HashMap<String, String>();
+ labels.put("custom-label-1", "label1");
+ Map<String, String> overrideValues = new HashMap<String, String>();
+ labels.put("image.tag", "latest");
+ labels.put("dcae_collector_ip", "1.2.3.4");
+ BpmnInstanceRequest bpmnInstanceRequest = new BpmnInstanceRequest();
+ bpmnInstanceRequest.setCloudRegionId("v1");
+ bpmnInstanceRequest.setLabels(labels);
+ bpmnInstanceRequest.setModelInvariantId("krd");
+ bpmnInstanceRequest.setModelVersionId("p1");
+ bpmnInstanceRequest.setOverrideValues(overrideValues);
+ bpmnInstanceRequest.setVfModuleUUID("20200824");
+
+ String mockedResponse = "K8sRBProfileName is required";
+ String actualResponse = cnfAdapterRest.createInstance(bpmnInstanceRequest);
+ assertNotNull(actualResponse);
+ assertEquals(mockedResponse, actualResponse);
+ }
+
+}
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml
index ad41b0f050..eb6cba5510 100644
--- a/adapters/mso-openstack-adapters/pom.xml
+++ b/adapters/mso-openstack-adapters/pom.xml
@@ -298,7 +298,7 @@
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
- <version>1.4.0</version>
+ <version>1.4.1</version>
</dependency>
<!-- added for unit testing -->
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
index 45d91c26c4..10f39f717f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
@@ -49,6 +49,7 @@ import org.apache.commons.validator.routines.InetAddressValidator;
import org.onap.aai.domain.yang.Flavor;
import org.onap.aai.domain.yang.Image;
import org.onap.aai.domain.yang.L3InterfaceIpv4AddressList;
+import org.onap.aai.domain.yang.L3InterfaceIpv6AddressList;
import org.onap.aai.domain.yang.L3Network;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.PInterface;
@@ -524,6 +525,20 @@ public class HeatBridgeImpl implements HeatBridgeApi {
.cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId())
.lInterface(lIf.getInterfaceName()).l3InterfaceIpv4AddressList(ipAddress)),
Optional.of(lInterfaceIp));
+ } else if (InetAddressValidator.getInstance().isValidInet6Address(ipAddress)) {
+ Subnet subnet = osClient.getSubnetById(ip.getSubnetId());
+ IPAddressString cidr = new IPAddressString(subnet.getCidr());
+ L3InterfaceIpv6AddressList ipv6 = new L3InterfaceIpv6AddressList();
+ ipv6.setL3InterfaceIpv6Address(ipAddress);
+ ipv6.setNeutronNetworkId(port.getNetworkId());
+ ipv6.setNeutronSubnetId(ip.getSubnetId());
+ ipv6.setL3InterfaceIpv6PrefixLength(Long.parseLong(cidr.getNetworkPrefixLength().toString()));
+
+ transaction.createIfNotExists(
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
+ .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId())
+ .lInterface(lIf.getInterfaceName()).l3InterfaceIpv6AddressList(ipAddress)),
+ Optional.of(ipv6));
}
}
}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
index 8c21e3f7f7..03f6c737f3 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
@@ -423,6 +423,18 @@ public class HeatBridgeImplTest {
when(port.getProfile()).thenReturn(ImmutableMap.of(HeatBridgeConstants.OS_PCI_SLOT_KEY, pfPciId,
HeatBridgeConstants.OS_PHYSICAL_NETWORK_KEY, "physical_network_id"));
+ IP ip = mock(IP.class);
+
+ Set<IP> ipSet = new HashSet<>();
+ ipSet.add(ip);
+ when(ip.getIpAddress()).thenReturn("2606:ae00:2e60:100::226");
+ when(ip.getSubnetId()).thenReturn("testSubnetId");
+ when(port.getFixedIps()).thenAnswer(x -> ipSet);
+
+ Subnet subnet = mock(Subnet.class);
+ when(subnet.getCidr()).thenReturn("169.254.100.0/24");
+ when(osClient.getSubnetById("testSubnetId")).thenReturn(subnet);
+
Network network = mock(Network.class);
when(network.getId()).thenReturn("test-network-id");
when(network.getNetworkType()).thenReturn(NetworkType.VLAN);
@@ -446,8 +458,9 @@ public class HeatBridgeImplTest {
heatbridge.buildAddVserverLInterfacesToAaiAction(stackResources, Arrays.asList("1", "2"), "CloudOwner");
// Assert
- verify(transaction, times(15)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
+ verify(transaction, times(20)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
verify(osClient, times(5)).getPortById(anyString());
+ verify(osClient, times(5)).getSubnetById("testSubnetId");
verify(osClient, times(10)).getNetworkById(anyString());
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
index 08c032fba3..146889351a 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
@@ -64,208 +64,211 @@ import org.slf4j.LoggerFactory
class SniroHomingV1 extends AbstractServiceTaskProcessor{
private static final Logger logger = LoggerFactory.getLogger( SniroHomingV1.class);
- ExceptionUtil exceptionUtil = new ExceptionUtil()
- JsonUtils jsonUtil = new JsonUtils()
- SniroUtils sniroUtils = new SniroUtils(this)
-
- /**
- * This method validates the incoming variables.
- * The method then prepares the sniro request
- * and posts it to sniro's rest api.
- *
- * @param execution
- *
- * @author cb645j
- */
- public void callSniro(DelegateExecution execution){
- execution.setVariable("prefix","HOME_")
- logger.trace("Started Sniro Homing Call Sniro ")
- try{
- execution.setVariable("rollbackData", null)
- execution.setVariable("rolledBack", false)
-
- String requestId = execution.getVariable("msoRequestId")
- logger.debug("Incoming Request Id is: " + requestId)
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
- logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
- ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
- logger.debug("Incoming Service Decomposition is: " + serviceDecomposition)
- String subscriberInfo = execution.getVariable("subscriberInfo")
- logger.debug("Incoming Subscriber Information is: " + subscriberInfo)
-
- if(isBlank(requestId) || isBlank(serviceInstanceId) || isBlank(serviceDecomposition.toString()) || isBlank(subscriberInfo)){
- exceptionUtil.buildAndThrowWorkflowException(execution, 4000, "A required input variable is missing or null")
- }else{
- String subId = jsonUtil.getJsonValue(subscriberInfo, "globalSubscriberId")
- String subName = jsonUtil.getJsonValue(subscriberInfo, "subscriberName")
- String subCommonSiteId = ""
- if(jsonUtil.jsonElementExist(subscriberInfo, "subscriberCommonSiteId")){
- subCommonSiteId = jsonUtil.getJsonValue(subscriberInfo, "subscriberCommonSiteId")
- }
- Subscriber subscriber = new Subscriber(subId, subName, subCommonSiteId)
-
- String cloudConfiguration = execution.getVariable("cloudConfiguration") // TODO Currently not being used
- String homingParameters = execution.getVariable("homingParameters") // (aka. request parameters) Should be json format. TODO confirm its json format
-
- //Authentication
- String authHeader = UrnPropertiesReader.getVariable("sniro.manager.headers.auth", execution)
- execution.setVariable("BasicAuthHeaderValue", authHeader)
-
- //Prepare Callback
- String timeout = execution.getVariable("timeout")
- if(isBlank(timeout)){
- timeout = UrnPropertiesReader.getVariable("sniro.manager.timeout", execution)
- if(isBlank(timeout)) {
- timeout = "PT30M";
- }
- }
- logger.debug("Async Callback Timeout will be: " + timeout)
-
- execution.setVariable("timeout", timeout);
- execution.setVariable("correlator", requestId);
- execution.setVariable("messageType", "SNIROResponse");
-
- //Build Request & Call Sniro
- String sniroRequest = sniroUtils.buildRequest(execution, requestId, serviceDecomposition, subscriber, homingParameters)
- execution.setVariable("sniroRequest", sniroRequest)
- logger.debug("SNIRO Request is: " + sniroRequest)
-
- String endpoint = UrnPropertiesReader.getVariable("sniro.manager.uri.v1", execution)
- String host = UrnPropertiesReader.getVariable("sniro.manager.host", execution)
- String urlString = host + endpoint
- logger.debug("Sniro Url is: " + urlString)
-
- URL url = new URL(urlString);
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
- httpClient.addAdditionalHeader("Authorization", authHeader)
- Response httpResponse = httpClient.post(sniroRequest)
-
- int responseCode = httpResponse.getStatus()
-
- logger.debug("Sniro sync response code is: " + responseCode)
- if(httpResponse.hasEntity()){
- logger.debug("Sniro sync response is: " + httpResponse.readEntity(String.class))
- }
-
- if(responseCode != 202){
- exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from Sniro.")
- }
-
- logger.trace("Completed Sniro Homing Call Sniro")
- }
- }catch(BpmnError b){
- throw b
- }catch(Exception e){
- logger.debug("Error encountered within Homing CallSniro method: " + e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Homing CallSniro: " + e.getMessage())
- }
- }
-
- /**
- * This method processes the callback response
- * and the contained homing solution. It sets
- * homing solution assignment and license
- * information to the corresponding resources
- *
- * @param execution
- *
- * @author cb645j
- */
- public void processHomingSolution(DelegateExecution execution){
- logger.trace("Started Sniro Homing Process Homing Solution")
- try{
- String response = execution.getVariable("asyncCallbackResponse")
- logger.debug("Sniro Async Callback Response is: " + response)
-
- sniroUtils.validateCallbackResponse(execution, response)
-
- ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
- List<Resource> resourceList = decomposition.getServiceResources()
-
- if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){
- String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
- JSONArray arr = new JSONArray(placements)
- for(int i = 0; i < arr.length(); i++){
- JSONObject placement = arr.getJSONObject(i)
- String jsonServiceResourceId = placement.getString("serviceResourceId")
- for(Resource resource:resourceList){
- String serviceResourceId = resource.getResourceId()
- if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
- //match
- String inventoryType = placement.getString("inventoryType")
- resource.getHomingSolution().setInventoryType(InventoryType.valueOf(inventoryType))
- resource.getHomingSolution().setCloudRegionId(placement.getString("cloudRegionId"))
- resource.getHomingSolution().setRehome(placement.getBoolean("isRehome"))
- JSONArray assignmentArr = placement.getJSONArray("assignmentInfo")
- Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "variableName", "variableValue")
- resource.getHomingSolution().setCloudOwner(assignmentMap.get("cloudOwner"))
- resource.getHomingSolution().setAicClli(assignmentMap.get("aicClli"))
- resource.getHomingSolution().setAicVersion(assignmentMap.get("aicVersion"))
- if(inventoryType.equalsIgnoreCase("service")){
- VnfResource vnf = new VnfResource()
- vnf.setVnfHostname(assignmentMap.get("vnfHostName"))
- resource.getHomingSolution().setVnf(vnf)
- resource.getHomingSolution().setServiceInstanceId(placement.getString("serviceInstanceId"))
- }
- }
- }
- }
- }
-
- if(JsonUtils.jsonElementExist(response, "solutionInfo.licenseInfo")){
- String licenseInfo = jsonUtil.getJsonValue(response, "solutionInfo.licenseInfo")
- JSONArray licenseArr = new JSONArray(licenseInfo)
- for(int l = 0; l < licenseArr.length(); l++){
- JSONObject license = licenseArr.getJSONObject(l)
- String jsonServiceResourceId = license.getString("serviceResourceId")
- for(Resource resource:resourceList){
- String serviceResourceId = resource.getResourceId()
- if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
- //match
- String jsonEntitlementPoolList = jsonUtil.getJsonValue(license.toString(), "entitlementPoolList")
- List<String> entitlementPoolList = jsonUtil.StringArrayToList(execution, jsonEntitlementPoolList)
- resource.getHomingSolution().getLicense().setEntitlementPoolList(entitlementPoolList)
-
- String jsonLicenseKeyGroupList = jsonUtil.getJsonValue(license.toString(), "licenseKeyGroupList")
- List<String> licenseKeyGroupList = jsonUtil.StringArrayToList(execution, jsonLicenseKeyGroupList)
- resource.getHomingSolution().getLicense().setLicenseKeyGroupList(licenseKeyGroupList)
- }
- }
- }
- }
- execution.setVariable("serviceDecomposition", decomposition)
-
- logger.trace("Completed Sniro Homing Process Homing Solution")
- }catch(BpmnError b){
- throw b
- }catch(Exception e){
- logger.debug("Error encountered within Homing ProcessHomingSolution method: " + e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Sniro Homing Process Solution")
- }
- }
-
- /**
- * This method logs the start of DHVCreateService
- * to make debugging easier.
- *
- * @param - execution
- * @author cb645j
- */
- public String logStart(DelegateExecution execution){
- String requestId = execution.getVariable("testReqId")
- if(isBlank(requestId)){
- requestId = execution.getVariable("msoRequestId")
- }
- execution.setVariable("DHVCS_requestId", requestId)
- logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
- logger.debug("****** Homing Subflow Global Debug Enabled: " + execution.getVariable("isDebugLogEnabled") + " *****")
- logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
- }
-
-
- /**
- * Auto-generated method stub
- */
- public void preProcessRequest(DelegateExecution execution){}
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ JsonUtils jsonUtil = new JsonUtils()
+ SniroUtils sniroUtils = new SniroUtils(this)
+
+ /**
+ * This method validates the incoming variables.
+ * The method then prepares the sniro request
+ * and posts it to sniro's rest api.
+ *
+ * @param execution
+ *
+ * @author cb645j
+ */
+ public void callSniro(DelegateExecution execution){
+ execution.setVariable("prefix","HOME_")
+ logger.trace("Started Sniro Homing Call Sniro ")
+ try{
+ execution.setVariable("rollbackData", null)
+ execution.setVariable("rolledBack", false)
+
+ String requestId = execution.getVariable("msoRequestId")
+ logger.debug("Incoming Request Id is: " + requestId)
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ logger.debug("Incoming Service Decomposition is: " + serviceDecomposition)
+ String subscriberInfo = execution.getVariable("subscriberInfo")
+ logger.debug("Incoming Subscriber Information is: " + subscriberInfo)
+
+ if(isBlank(requestId) || isBlank(serviceInstanceId) || isBlank(serviceDecomposition.toString()) || isBlank(subscriberInfo)){
+ exceptionUtil.buildAndThrowWorkflowException(execution, 4000, "A required input variable is missing or null")
+ }else{
+ String subId = jsonUtil.getJsonValue(subscriberInfo, "globalSubscriberId")
+ String subName = jsonUtil.getJsonValue(subscriberInfo, "subscriberName")
+ String subCommonSiteId = ""
+ if(jsonUtil.jsonElementExist(subscriberInfo, "subscriberCommonSiteId")){
+ subCommonSiteId = jsonUtil.getJsonValue(subscriberInfo, "subscriberCommonSiteId")
+ }
+ Subscriber subscriber = new Subscriber(subId, subName, subCommonSiteId)
+
+ String cloudConfiguration = execution.getVariable("cloudConfiguration") // TODO Currently not being used
+ String homingParameters = execution.getVariable("homingParameters") // (aka. request parameters) Should be json format. TODO confirm its json format
+
+ //Authentication
+ String authHeader = UrnPropertiesReader.getVariable("sniro.manager.headers.auth", execution)
+ execution.setVariable("BasicAuthHeaderValue", authHeader)
+
+ //Prepare Callback
+ String timeout = execution.getVariable("timeout")
+ if(isBlank(timeout)){
+ timeout = UrnPropertiesReader.getVariable("sniro.manager.timeout", execution)
+ if(isBlank(timeout)) {
+ timeout = "PT30M";
+ }
+ }
+ logger.debug("Async Callback Timeout will be: " + timeout)
+
+ execution.setVariable("timeout", timeout);
+ execution.setVariable("correlator", requestId);
+ execution.setVariable("messageType", "SNIROResponse");
+
+ //Build Request & Call Sniro
+ String sniroRequest = sniroUtils.buildRequest(execution, requestId, serviceDecomposition, subscriber, homingParameters)
+ execution.setVariable("sniroRequest", sniroRequest)
+ logger.debug("SNIRO Request is: " + sniroRequest)
+
+ String endpoint = UrnPropertiesReader.getVariable("sniro.manager.uri.v1", execution)
+ String host = UrnPropertiesReader.getVariable("sniro.manager.host", execution)
+ String urlString = host + endpoint
+ logger.debug("Sniro Url is: " + urlString)
+
+ URL url = new URL(urlString);
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
+ httpClient.addAdditionalHeader("Authorization", authHeader)
+ Response httpResponse = httpClient.post(sniroRequest)
+
+ int responseCode = httpResponse.getStatus()
+
+ logger.debug("Sniro sync response code is: " + responseCode)
+ if(httpResponse.hasEntity()){
+ logger.debug("Sniro sync response is: " + httpResponse.readEntity(String.class))
+ }
+
+ if(responseCode != 202){
+ exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from Sniro.")
+ }
+
+ logger.trace("Completed Sniro Homing Call Sniro")
+ }
+ }catch(BpmnError b){
+ throw b
+ }catch(Exception e){
+ logger.debug("Error encountered within Homing CallSniro method: " + e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Homing CallSniro: " + e.getMessage())
+ }
+ }
+
+ /**
+ * This method processes the callback response
+ * and the contained homing solution. It sets
+ * homing solution assignment and license
+ * information to the corresponding resources
+ *
+ * @param execution
+ *
+ * @author cb645j
+ */
+ public void processHomingSolution(DelegateExecution execution){
+ logger.trace("Started Sniro Homing Process Homing Solution")
+ try{
+ String response = execution.getVariable("asyncCallbackResponse")
+ logger.debug("Sniro Async Callback Response is: " + response)
+
+ sniroUtils.validateCallbackResponse(execution, response)
+
+ ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
+ List<Resource> resourceList = decomposition.getServiceResources()
+
+ if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){
+ String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
+ JSONArray arr = new JSONArray(placements)
+ for(int i = 0; i < arr.length(); i++){
+ JSONObject placement = arr.getJSONObject(i)
+ String jsonServiceResourceId = placement.getString("serviceResourceId")
+ for(Resource resource:resourceList){
+ String serviceResourceId = resource.getResourceId()
+ if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
+ //match
+ String inventoryType = placement.getString("inventoryType")
+ resource.getHomingSolution().setInventoryType(InventoryType.valueOf(inventoryType))
+ resource.getHomingSolution().setCloudRegionId(placement.getString("cloudRegionId"))
+ resource.getHomingSolution().setRehome(placement.getBoolean("isRehome"))
+ JSONArray assignmentArr = placement.getJSONArray("assignmentInfo")
+ Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "variableName", "variableValue")
+ resource.getHomingSolution().setCloudOwner(assignmentMap.get("cloudOwner"))
+ resource.getHomingSolution().setAicClli(assignmentMap.get("aicClli"))
+ resource.getHomingSolution().setAicVersion(assignmentMap.get("aicVersion"))
+ if(inventoryType.equalsIgnoreCase("service")){
+ VnfResource vnf = new VnfResource()
+ vnf.setVnfHostname(assignmentMap.get("vnfHostName"))
+ resource.getHomingSolution().setVnf(vnf)
+ resource.getHomingSolution().setServiceInstanceId(placement.getString("serviceInstanceId"))
+ }
+ if(placement.getBoolean("isRehome")) {
+ resource.getHomingSolution().setAllottedResourceId(assignmentMap.get("serviceResourceId"))
+ }
+ }
+ }
+ }
+ }
+
+ if(JsonUtils.jsonElementExist(response, "solutionInfo.licenseInfo")){
+ String licenseInfo = jsonUtil.getJsonValue(response, "solutionInfo.licenseInfo")
+ JSONArray licenseArr = new JSONArray(licenseInfo)
+ for(int l = 0; l < licenseArr.length(); l++){
+ JSONObject license = licenseArr.getJSONObject(l)
+ String jsonServiceResourceId = license.getString("serviceResourceId")
+ for(Resource resource:resourceList){
+ String serviceResourceId = resource.getResourceId()
+ if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
+ //match
+ String jsonEntitlementPoolList = jsonUtil.getJsonValue(license.toString(), "entitlementPoolList")
+ List<String> entitlementPoolList = jsonUtil.StringArrayToList(execution, jsonEntitlementPoolList)
+ resource.getHomingSolution().getLicense().setEntitlementPoolList(entitlementPoolList)
+
+ String jsonLicenseKeyGroupList = jsonUtil.getJsonValue(license.toString(), "licenseKeyGroupList")
+ List<String> licenseKeyGroupList = jsonUtil.StringArrayToList(execution, jsonLicenseKeyGroupList)
+ resource.getHomingSolution().getLicense().setLicenseKeyGroupList(licenseKeyGroupList)
+ }
+ }
+ }
+ }
+ execution.setVariable("serviceDecomposition", decomposition)
+
+ logger.trace("Completed Sniro Homing Process Homing Solution")
+ }catch(BpmnError b){
+ throw b
+ }catch(Exception e){
+ logger.debug("Error encountered within Homing ProcessHomingSolution method: " + e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Sniro Homing Process Solution")
+ }
+ }
+
+ /**
+ * This method logs the start of DHVCreateService
+ * to make debugging easier.
+ *
+ * @param - execution
+ * @author cb645j
+ */
+ public String logStart(DelegateExecution execution){
+ String requestId = execution.getVariable("testReqId")
+ if(isBlank(requestId)){
+ requestId = execution.getVariable("msoRequestId")
+ }
+ execution.setVariable("DHVCS_requestId", requestId)
+ logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
+ logger.debug("****** Homing Subflow Global Debug Enabled: " + execution.getVariable("isDebugLogEnabled") + " *****")
+ logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
+ }
+
+
+ /**
+ * Auto-generated method stub
+ */
+ public void preProcessRequest(DelegateExecution execution){}
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
index 309b053589..ddfb29e97e 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
@@ -37,6 +37,7 @@ public class HomingSolution extends JsonWrapper implements Serializable {
private InventoryType inventoryType;
private boolean isRehome;
private String serviceInstanceId; // TODO should start using si object instead
+ private String allottedResourceId;
private String cloudOwner;
private String cloudRegionId;
private String aicClli;
@@ -74,6 +75,14 @@ public class HomingSolution extends JsonWrapper implements Serializable {
this.serviceInstanceId = serviceInstanceId;
}
+ public String getAllottedResourceId() {
+ return allottedResourceId;
+ }
+
+ public void setAllottedResourceId(String allottedResourceId) {
+ this.allottedResourceId = allottedResourceId;
+ }
+
public String getCloudOwner() {
return cloudOwner;
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java b/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
index 64f1df2590..5b070bb00f 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
index 1d8b15e69a..bdc2c608e2 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
@@ -26,6 +26,7 @@ import java.io.Serializable;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AllocateCnNssi implements Serializable {
+ @Deprecated
public final static String URL = "/api/rest/provMns/v1/NSS/SliceProfiles";
private static final long serialVersionUID = 4909074863148869163L;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java
deleted file mode 100644
index 1dc6d0f1c5..0000000000
--- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.onap.so.beans.nsmf;
-
-public class AllocateNssi {
-}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java b/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
index ca0c684779..99a8525974 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java b/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java
index a55672f37f..dab9b3a990 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java b/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java
index 8206b527cd..57cb2b02aa 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
public enum ModifyAction {
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java
index 67701a1922..a190a82646 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java
index e421df456b..7061ec2ff3 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java
index 5a1393376f..3292730f29 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
index f87c032096..7a52cc85cb 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import lombok.Data;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java
index 62077050ce..919a5d8114 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java b/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
index bfbbbd3bda..aa2579edf8 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License")
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF 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.beans.nsmf;
import lombok.Data;
diff --git a/docs/api/swagger/swagger.html b/docs/api/swagger/swagger.html
index 5d7c963a8a..514c2bdda2 100644
--- a/docs/api/swagger/swagger.html
+++ b/docs/api/swagger/swagger.html
@@ -843,11 +843,191 @@ margin-bottom: 20px;
},
"description" : "This describes the subnet capabilities that can be queried"
};
+ defs["RetrievingWorkflowResponse"] = {
+ "type" : "object",
+ "properties" : {
+ "workflowSpecificationList" : {
+ "type" : "array",
+ "description" : "List of Workflow specification data",
+ "items" : {
+ "$ref" : "#/definitions/WorkflowSpecification"
+ }
+ }
+ },
+ "description" : "Response body of fetching workflows using resource target"
+};
+ defs["ServiceLevelWorkflowExecution"] = {
+ "type" : "object",
+ "properties" : {
+ "requestInfo" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_requestInfo"
+ },
+ "modelInfo" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_modelInfo"
+ },
+ "requestParameters" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_requestParameters"
+ },
+ "subscriberInfo" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_subscriberInfo"
+ },
+ "project" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_project"
+ },
+ "owningEntity" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_owningEntity"
+ }
+ },
+ "description" : "This describes the request body of service level custom workflow execution"
+};
+ defs["ServiceLevelWorkflowExecution_modelInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "modelType" : {
+ "type" : "string",
+ "description" : "Type of the model to be executed"
+ },
+ "modelInvariantUuid" : {
+ "type" : "string",
+ "description" : "Model invariant id corresponding to the service"
+ },
+ "modelUuid" : {
+ "type" : "string",
+ "description" : "Model uuid corresponding to the service"
+ },
+ "modelVersionId" : {
+ "type" : "string",
+ "description" : "Model version of the service instance"
+ },
+ "modelName" : {
+ "type" : "string",
+ "description" : "Name of the service"
+ },
+ "modelVersion" : {
+ "type" : "string",
+ "description" : "Version of the service instance"
+ }
+ },
+ "description" : "Parameters related to the service model"
+};
+ defs["ServiceLevelWorkflowExecution_owningEntity"] = {
+ "type" : "object",
+ "properties" : {
+ "owningEntityId" : {
+ "type" : "string",
+ "description" : "Id of the owning Entity"
+ },
+ "owningEntityName" : {
+ "type" : "string",
+ "description" : "Name of the owning Entity"
+ }
+ },
+ "description" : "Object describes the entity details"
+};
+ defs["ServiceLevelWorkflowExecution_project"] = {
+ "type" : "object",
+ "properties" : {
+ "projectName" : {
+ "type" : "string",
+ "description" : "Name of the target project"
+ }
+ },
+ "description" : "Information about the target project name"
+};
+ defs["ServiceLevelWorkflowExecution_requestInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "source" : {
+ "type" : "string",
+ "description" : "Name of the sender"
+ },
+ "suppressRollback" : {
+ "type" : "boolean",
+ "description" : "Enable/disable rollback suppression"
+ },
+ "requestorId" : {
+ "type" : "string",
+ "description" : "Id of the sender"
+ }
+ },
+ "description" : "Request object contains source information"
+};
+ defs["ServiceLevelWorkflowExecution_requestParameters"] = {
+ "type" : "object",
+ "properties" : {
+ "subscriptionServiceType" : {
+ "type" : "string",
+ "description" : "Type of service subscription"
+ }
+ },
+ "description" : "User parameter object"
+};
+ defs["ServiceLevelWorkflowExecution_subscriberInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "globalSubscriberId" : {
+ "type" : "string",
+ "description" : "Id of the subscriber sending the request"
+ }
+ },
+ "description" : "Subscriber id information"
+};
defs["SubnetTypes"] = {
"type" : "string",
"description" : "This describes allowed subnet types",
"enum" : [ "AN", "AN_NF", "CN", "TN_FH", "TN_MH", "TN_BH" ]
};
+ defs["WorkflowSpecification"] = {
+ "type" : "object",
+ "properties" : {
+ "artifactInfo" : {
+ "$ref" : "#/definitions/WorkflowSpecification_artifactInfo"
+ }
+ },
+ "description" : "This describes workflow specification object"
+};
+ defs["WorkflowSpecification_artifactInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "artifactType" : {
+ "type" : "string",
+ "description" : "Type of the artifact to be queried"
+ },
+ "artifactUuid" : {
+ "type" : "string",
+ "description" : "UUID of the artifact"
+ },
+ "artifactName" : {
+ "type" : "string",
+ "description" : "Name of the artifact"
+ },
+ "artifactVersion" : {
+ "type" : "string",
+ "description" : "Artifact's Version"
+ },
+ "artifactDescription" : {
+ "type" : "string",
+ "description" : ""
+ },
+ "workflowName" : {
+ "type" : "string",
+ "description" : "Name of the workflow fetched for the resource type"
+ },
+ "operationName" : {
+ "type" : "string",
+ "description" : "Mapped operation name of the corresponding workflow"
+ },
+ "workflowSource" : {
+ "type" : "string",
+ "description" : ""
+ },
+ "workflowResourceTarget" : {
+ "type" : "string",
+ "description" : "Type of Resource mapped against the workflow"
+ }
+ },
+ "description" : "Attributes related to artifact information "
+};
</script>
<div class="container-fluid">
@@ -930,6 +1110,10 @@ margin-bottom: 20px;
<li data-group="OnapsoinfracloudResourcesRequests" data-name="unlockOrchestrationRequestForReqId" class="">
<a href="#api-OnapsoinfracloudResourcesRequests-unlockOrchestrationRequestForReqId">unlockOrchestrationRequestForReqId</a>
</li>
+ <li class="nav-header" data-group="OnapsoinfrainstanceManagement"><a href="#api-OnapsoinfrainstanceManagement">API Methods - OnapsoinfrainstanceManagement</a></li>
+ <li data-group="OnapsoinfrainstanceManagement" data-name="executeServiceLevelCustomWorkflow" class="">
+ <a href="#api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow">executeServiceLevelCustomWorkflow</a>
+ </li>
<li class="nav-header" data-group="OnapsoinframodelDistributions"><a href="#api-OnapsoinframodelDistributions">API Methods - OnapsoinframodelDistributions</a></li>
<li data-group="OnapsoinframodelDistributions" data-name="updateModelDistributionStatus" class="">
<a href="#api-OnapsoinframodelDistributions-updateModelDistributionStatus">updateModelDistributionStatus</a>
@@ -1067,6 +1251,10 @@ margin-bottom: 20px;
<li data-group="Onapsoinfratasks" data-name="queryFilters" class="">
<a href="#api-Onapsoinfratasks-queryFilters">queryFilters</a>
</li>
+ <li class="nav-header" data-group="OnapsoinfraworkflowSpecifications"><a href="#api-OnapsoinfraworkflowSpecifications">API Methods - OnapsoinfraworkflowSpecifications</a></li>
+ <li data-group="OnapsoinfraworkflowSpecifications" data-name="queryWorkflowSpecifications" class="">
+ <a href="#api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications">queryWorkflowSpecifications</a>
+ </li>
</ul>
</nav>
</div>
@@ -1449,7 +1637,7 @@ $(document).ready(function() {
<article id="api-E2eServiceInstances-compareModelwithTargetVersion-0" data-group="User" data-name="compareModelwithTargetVersion" data-version="0">
<div class="pull-left">
<h1>compareModelwithTargetVersion</h1>
- <p>Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId </p>
+ <p>Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId</p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
@@ -1536,7 +1724,7 @@ String *body = body_example; // (optional)
E2eServiceInstancesApi *apiInstance = [[E2eServiceInstancesApi alloc] init];
-// Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
+// Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
[apiInstance compareModelwithTargetVersionWith:serviceId
version:version
body:body
@@ -1596,7 +1784,7 @@ namespace Example
try
{
- // Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
+ // Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
apiInstance.compareModelwithTargetVersion(serviceId, version, body);
}
catch (Exception e)
@@ -1658,7 +1846,7 @@ version = version_example # String |
body = body_example # String | (optional)
try:
- # Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
+ # Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
api_instance.compare_modelwith_target_version(serviceId, version, body=body)
except ApiException as e:
print("Exception when calling E2eServiceInstancesApi->compareModelwithTargetVersion: %s\n" % e)</code></pre>
@@ -7385,6 +7573,366 @@ $(document).ready(function() {
</div>
<hr>
</section>
+ <section id="api-OnapsoinfrainstanceManagement">
+ <h1>OnapsoinfrainstanceManagement</h1>
+ <div id="api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow">
+ <article id="api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0" data-group="User" data-name="executeServiceLevelCustomWorkflow" data-version="0">
+ <div class="pull-left">
+ <h1>executeServiceLevelCustomWorkflow</h1>
+ <p>Executing service level custom workflow</p>
+ </div>
+ <div class="pull-right"></div>
+ <div class="clearfix"></div>
+ <p></p>
+ <p class="marked"></p>
+ <p></p>
+ <br />
+ <pre class="prettyprint language-html prettyprinted" data-type="post"><code><span class="pln">/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}</span></code></pre>
+ <p>
+ <h3>Usage and SDK Samples</h3>
+ </p>
+ <ul class="nav nav-tabs nav-tabs-examples">
+ <li class="active"><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-curl">Curl</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-java">Java</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-android">Android</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-groovy">Groovy</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-objc">Obj-C</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-javascript">JavaScript</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-angular">Angular</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-csharp">C#</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-php">PHP</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-perl">Perl</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-python">Python</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-curl">
+ <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}"</code></pre>
+ </div>
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-java">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.*;
+import io.swagger.client.auth.*;
+import io.swagger.client.model.*;
+import io.swagger.client.api.OnapsoinfrainstanceManagementApi;
+
+import java.io.File;
+import java.util.*;
+
+public class OnapsoinfrainstanceManagementApiExample {
+
+ public static void main(String[] args) {
+
+ OnapsoinfrainstanceManagementApi apiInstance = new OnapsoinfrainstanceManagementApi();
+ String version = version_example; // String |
+ String serviceInstanceId = serviceInstanceId_example; // String |
+ String workflowUUID = workflowUUID_example; // String |
+ ServiceLevelWorkflowExecution body = ; // ServiceLevelWorkflowExecution |
+ try {
+ apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfrainstanceManagementApi#executeServiceLevelCustomWorkflow");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-android">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.api.OnapsoinfrainstanceManagementApi;
+
+public class OnapsoinfrainstanceManagementApiExample {
+
+ public static void main(String[] args) {
+ OnapsoinfrainstanceManagementApi apiInstance = new OnapsoinfrainstanceManagementApi();
+ String version = version_example; // String |
+ String serviceInstanceId = serviceInstanceId_example; // String |
+ String workflowUUID = workflowUUID_example; // String |
+ ServiceLevelWorkflowExecution body = ; // ServiceLevelWorkflowExecution |
+ try {
+ apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfrainstanceManagementApi#executeServiceLevelCustomWorkflow");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+ <!--
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-groovy">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div> -->
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-objc">
+ <pre class="prettyprint"><code class="language-cpp">String *version = version_example; //
+String *serviceInstanceId = serviceInstanceId_example; //
+String *workflowUUID = workflowUUID_example; //
+ServiceLevelWorkflowExecution *body = ; // (optional)
+
+OnapsoinfrainstanceManagementApi *apiInstance = [[OnapsoinfrainstanceManagementApi alloc] init];
+
+// Executing service level custom workflow
+[apiInstance executeServiceLevelCustomWorkflowWith:version
+ serviceInstanceId:serviceInstanceId
+ workflowUUID:workflowUUID
+ body:body
+ completionHandler: ^(NSError* error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ }
+ }];
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-javascript">
+ <pre class="prettyprint"><code class="language-js">var SoGuilinApIs = require('so_guilin_ap_is');
+
+var api = new SoGuilinApIs.OnapsoinfrainstanceManagementApi()
+
+var version = version_example; // {String}
+
+var serviceInstanceId = serviceInstanceId_example; // {String}
+
+var workflowUUID = workflowUUID_example; // {String}
+
+var opts = {
+ 'body': // {ServiceLevelWorkflowExecution}
+};
+
+var callback = function(error, data, response) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully.');
+ }
+};
+api.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, opts, callback);
+</code></pre>
+ </div>
+
+ <!--<div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-angular">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div>-->
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-csharp">
+ <pre class="prettyprint"><code class="language-cs">using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+ public class executeServiceLevelCustomWorkflowExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new OnapsoinfrainstanceManagementApi();
+ var version = version_example; // String |
+ var serviceInstanceId = serviceInstanceId_example; // String |
+ var workflowUUID = workflowUUID_example; // String |
+ var body = new ServiceLevelWorkflowExecution(); // ServiceLevelWorkflowExecution | (optional)
+
+ try
+ {
+ // Executing service level custom workflow
+ apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling OnapsoinfrainstanceManagementApi.executeServiceLevelCustomWorkflow: " + e.Message );
+ }
+ }
+ }
+}
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-php">
+ <pre class="prettyprint"><code class="language-php"><&#63;php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+$api_instance = new Swagger\Client\Api\OnapsoinfrainstanceManagementApi();
+$version = version_example; // String |
+$serviceInstanceId = serviceInstanceId_example; // String |
+$workflowUUID = workflowUUID_example; // String |
+$body = ; // ServiceLevelWorkflowExecution |
+
+try {
+ $api_instance->executeServiceLevelCustomWorkflow($version, $serviceInstanceId, $workflowUUID, $body);
+} catch (Exception $e) {
+ echo 'Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: ', $e->getMessage(), PHP_EOL;
+}
+?></code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-perl">
+ <pre class="prettyprint"><code class="language-perl">use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::OnapsoinfrainstanceManagementApi;
+
+my $api_instance = WWW::SwaggerClient::OnapsoinfrainstanceManagementApi->new();
+my $version = version_example; # String |
+my $serviceInstanceId = serviceInstanceId_example; # String |
+my $workflowUUID = workflowUUID_example; # String |
+my $body = WWW::SwaggerClient::Object::ServiceLevelWorkflowExecution->new(); # ServiceLevelWorkflowExecution |
+
+eval {
+ $api_instance->executeServiceLevelCustomWorkflow(version => $version, serviceInstanceId => $serviceInstanceId, workflowUUID => $workflowUUID, body => $body);
+};
+if ($@) {
+ warn "Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: $@\n";
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-python">
+ <pre class="prettyprint"><code class="language-python">from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# create an instance of the API class
+api_instance = swagger_client.OnapsoinfrainstanceManagementApi()
+version = version_example # String |
+serviceInstanceId = serviceInstanceId_example # String |
+workflowUUID = workflowUUID_example # String |
+body = # ServiceLevelWorkflowExecution | (optional)
+
+try:
+ # Executing service level custom workflow
+ api_instance.execute_service_level_custom_workflow(version, serviceInstanceId, workflowUUID, body=body)
+except ApiException as e:
+ print("Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: %s\n" % e)</code></pre>
+ </div>
+ </div>
+
+ <h2>Parameters</h2>
+
+ <div class="methodsubtabletitle">Path parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">version*</td>
+<td>
+
+
+ <div id="d2e199_executeServiceLevelCustomWorkflow_version">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ <tr><td style="width:150px;">serviceInstanceId*</td>
+<td>
+
+
+ <div id="d2e199_executeServiceLevelCustomWorkflow_serviceInstanceId">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ <tr><td style="width:150px;">workflow_UUID*</td>
+<td>
+
+
+ <div id="d2e199_executeServiceLevelCustomWorkflow_workflowUUID">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ </table>
+
+
+ <div class="methodsubtabletitle">Body parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">body </td>
+<td>
+
+
+<script>
+$(document).ready(function() {
+ var schemaWrapper = {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution"
+ }
+};
+ var schema = schemaWrapper.schema;
+ if (schema.$ref != null) {
+ schema = defsParser.$refs.get(schema.$ref);
+ } else {
+ schemaWrapper.definitions = Object.assign({}, defs);
+ $RefParser.dereference(schemaWrapper).catch(function(err) {
+ console.log(err);
+ });
+ }
+
+ var view = new JSONSchemaView(schema,2,{isBodyParam: true});
+ var result = $('#d2e199_executeServiceLevelCustomWorkflow_body');
+ result.empty();
+ result.append(view.render());
+});
+</script>
+<div id="d2e199_executeServiceLevelCustomWorkflow_body"></div>
+</td>
+</tr>
+
+ </table>
+
+
+
+ <h2>Responses</h2>
+ <h3> Status: default - successful operation </h3>
+
+ <ul class="nav nav-tabs nav-tabs-examples" >
+ </ul>
+
+ <div class="tab-content" style='margin-bottom: 10px;'>
+ </div>
+
+ </article>
+ </div>
+ <hr>
+ </section>
<section id="api-OnapsoinframodelDistributions">
<h1>OnapsoinframodelDistributions</h1>
<div id="api-OnapsoinframodelDistributions-updateModelDistributionStatus">
@@ -22297,6 +22845,333 @@ except ApiException as e:
</div>
<hr>
</section>
+ <section id="api-OnapsoinfraworkflowSpecifications">
+ <h1>OnapsoinfraworkflowSpecifications</h1>
+ <div id="api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications">
+ <article id="api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0" data-group="User" data-name="queryWorkflowSpecifications" data-version="0">
+ <div class="pull-left">
+ <h1>queryWorkflowSpecifications</h1>
+ <p>Retrieve Workflow details based on the filter criteria</p>
+ </div>
+ <div class="pull-right"></div>
+ <div class="clearfix"></div>
+ <p></p>
+ <p class="marked"></p>
+ <p></p>
+ <br />
+ <pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/onap/so/infra/workflowSpecifications/{version}/workflows</span></code></pre>
+ <p>
+ <h3>Usage and SDK Samples</h3>
+ </p>
+ <ul class="nav nav-tabs nav-tabs-examples">
+ <li class="active"><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-curl">Curl</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-java">Java</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-android">Android</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-groovy">Groovy</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-objc">Obj-C</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-javascript">JavaScript</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-angular">Angular</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-csharp">C#</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-php">PHP</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-perl">Perl</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-python">Python</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-curl">
+ <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/workflowSpecifications/{version}/workflows?resourceTarget="</code></pre>
+ </div>
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-java">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.*;
+import io.swagger.client.auth.*;
+import io.swagger.client.model.*;
+import io.swagger.client.api.OnapsoinfraworkflowSpecificationsApi;
+
+import java.io.File;
+import java.util.*;
+
+public class OnapsoinfraworkflowSpecificationsApiExample {
+
+ public static void main(String[] args) {
+
+ OnapsoinfraworkflowSpecificationsApi apiInstance = new OnapsoinfraworkflowSpecificationsApi();
+ String version = version_example; // String |
+ String resourceTarget = resourceTarget_example; // String |
+ try {
+ RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfraworkflowSpecificationsApi#queryWorkflowSpecifications");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-android">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.api.OnapsoinfraworkflowSpecificationsApi;
+
+public class OnapsoinfraworkflowSpecificationsApiExample {
+
+ public static void main(String[] args) {
+ OnapsoinfraworkflowSpecificationsApi apiInstance = new OnapsoinfraworkflowSpecificationsApi();
+ String version = version_example; // String |
+ String resourceTarget = resourceTarget_example; // String |
+ try {
+ RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfraworkflowSpecificationsApi#queryWorkflowSpecifications");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+ <!--
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-groovy">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div> -->
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-objc">
+ <pre class="prettyprint"><code class="language-cpp">String *version = version_example; //
+String *resourceTarget = resourceTarget_example; // (optional)
+
+OnapsoinfraworkflowSpecificationsApi *apiInstance = [[OnapsoinfraworkflowSpecificationsApi alloc] init];
+
+// Retrieve Workflow details based on the filter criteria
+[apiInstance queryWorkflowSpecificationsWith:version
+ resourceTarget:resourceTarget
+ completionHandler: ^(RetrievingWorkflowResponse output, NSError* error) {
+ if (output) {
+ NSLog(@"%@", output);
+ }
+ if (error) {
+ NSLog(@"Error: %@", error);
+ }
+ }];
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-javascript">
+ <pre class="prettyprint"><code class="language-js">var SoGuilinApIs = require('so_guilin_ap_is');
+
+var api = new SoGuilinApIs.OnapsoinfraworkflowSpecificationsApi()
+
+var version = version_example; // {String}
+
+var opts = {
+ 'resourceTarget': resourceTarget_example // {String}
+};
+
+var callback = function(error, data, response) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+};
+api.queryWorkflowSpecifications(version, opts, callback);
+</code></pre>
+ </div>
+
+ <!--<div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-angular">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div>-->
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-csharp">
+ <pre class="prettyprint"><code class="language-cs">using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+ public class queryWorkflowSpecificationsExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new OnapsoinfraworkflowSpecificationsApi();
+ var version = version_example; // String |
+ var resourceTarget = resourceTarget_example; // String | (optional)
+
+ try
+ {
+ // Retrieve Workflow details based on the filter criteria
+ RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling OnapsoinfraworkflowSpecificationsApi.queryWorkflowSpecifications: " + e.Message );
+ }
+ }
+ }
+}
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-php">
+ <pre class="prettyprint"><code class="language-php"><&#63;php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+$api_instance = new Swagger\Client\Api\OnapsoinfraworkflowSpecificationsApi();
+$version = version_example; // String |
+$resourceTarget = resourceTarget_example; // String |
+
+try {
+ $result = $api_instance->queryWorkflowSpecifications($version, $resourceTarget);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: ', $e->getMessage(), PHP_EOL;
+}
+?></code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-perl">
+ <pre class="prettyprint"><code class="language-perl">use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::OnapsoinfraworkflowSpecificationsApi;
+
+my $api_instance = WWW::SwaggerClient::OnapsoinfraworkflowSpecificationsApi->new();
+my $version = version_example; # String |
+my $resourceTarget = resourceTarget_example; # String |
+
+eval {
+ my $result = $api_instance->queryWorkflowSpecifications(version => $version, resourceTarget => $resourceTarget);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: $@\n";
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-python">
+ <pre class="prettyprint"><code class="language-python">from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# create an instance of the API class
+api_instance = swagger_client.OnapsoinfraworkflowSpecificationsApi()
+version = version_example # String |
+resourceTarget = resourceTarget_example # String | (optional)
+
+try:
+ # Retrieve Workflow details based on the filter criteria
+ api_response = api_instance.query_workflow_specifications(version, resourceTarget=resourceTarget)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: %s\n" % e)</code></pre>
+ </div>
+ </div>
+
+ <h2>Parameters</h2>
+
+ <div class="methodsubtabletitle">Path parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">version*</td>
+<td>
+
+
+ <div id="d2e199_queryWorkflowSpecifications_version">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ </table>
+
+
+
+
+ <div class="methodsubtabletitle">Query parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">resourceTarget</td>
+<td>
+
+
+ <div id="d2e199_queryWorkflowSpecifications_resourceTarget">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ </table>
+
+ <h2>Responses</h2>
+ <h3> Status: default - List of workflow specifications on successful operation </h3>
+
+ <ul class="nav nav-tabs nav-tabs-examples" >
+ <li class="active">
+ <a data-toggle="tab" href="#responses-queryWorkflowSpecifications-default-schema">Schema</a>
+ </li>
+
+ </ul>
+
+ <div class="tab-content" style='margin-bottom: 10px;'>
+ <div class="tab-pane active" id="responses-queryWorkflowSpecifications-default-schema">
+ <div id='responses-queryWorkflowSpecifications-default-schema-default' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
+ <script>
+ $(document).ready(function() {
+ var schemaWrapper = {
+ "description" : "List of workflow specifications on successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/RetrievingWorkflowResponse"
+ }
+};
+ var schema = schemaWrapper.schema;
+ if (schema.$ref != null) {
+ schema = defsParser.$refs.get(schema.$ref);
+ } else {
+ schemaWrapper.definitions = defs;
+ $RefParser.dereference(schemaWrapper).catch(function(err) {
+ console.log(err);
+ });
+ }
+
+ //console.log(JSON.stringify(schema));
+ var view = new JSONSchemaView(schema, 3);
+ $('#responses-queryWorkflowSpecifications-default-schema-data').val(stringify(schema));
+ var result = $('#responses-queryWorkflowSpecifications-default-schema-default');
+ result.empty();
+ result.append(view.render());
+ });
+ </script>
+ </div>
+ <input id='responses-queryWorkflowSpecifications-default-schema-data' type='hidden' value=''></input>
+ </div>
+ </div>
+
+ </article>
+ </div>
+ <hr>
+ </section>
</div>
<div id="footer">
<div id="api-_footer">
diff --git a/docs/developer_info/Mso_Openstack_Adapter.rst b/docs/developer_info/Mso_Openstack_Adapter.rst
new file mode 100644
index 0000000000..a8ca362537
--- /dev/null
+++ b/docs/developer_info/Mso_Openstack_Adapter.rst
@@ -0,0 +1,796 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2020 Huawei Technologies Co., Ltd.
+
+MSO-OPENSTACK-ADAPTER :
+=======================
+
+.. contents:: :depth: 3
+
+Cloud site operations
+++++++++++++++++++++++
+* Here we have 3 api's createCloudRegion, updateCloudRegion, deleteCloudRegion.
+
+1.Create Cloud site/Cloud region:
+
+Path: /v1/cloud-region
+
+Method Type: POST
+
+Request Body:
+*************
+{
+ "id": "MTN13",
+ "regionId": "mtn13",
+ "cloudVersion": "3.0",
+ "clli": "MDT13",
+ "platform": "testFlatform",
+ "orchestrator": "testOrchestrator",
+ "cloudifyId": "mtn13",
+ "cloudOwner": "testCloudOwner",
+
+ "identityService": {
+ "identityUrl": "testUrl",
+ "msoId": "admin",
+ "msoPass": "admin",
+ "projectDomainName": "testDomain",
+ "userDomainName": "testDomain",
+ "adminTenant": "test",
+ "memberRole": "test",
+ "tenantMetadata": "test",
+ "identityServerType": "test",
+ "identityAuthenticationType": "test",
+ "lastUpdatedBy": "test",
+ "created": "date",
+ "updated": "date"
+
+ },
+
+ "identityServiceId": "123",
+ "lastUpdatedBy": "test",
+ "created": "test",
+ "updated": "test",
+ "supportFabric": "true",
+ "uri": "test"
+
+}
+
+* In this api we can create cloud region and cloud site and saving in catalog db and in AAI.
+
+* This api requires cloud-region-id and cloudSite as inputs.
+
+* In createCloudRegion two steps are there.
+
+* CreateRegionInCatalogDb(cloudSite) :- here we are creating cloud region in catalogdb if it is not exists in db(cloud_sites).
+
+* CreateCloudRegionInAAI(cloudSite) :- mapping cloudSite into cloudregion , this cloudregion we are creating in AAI and create CloudRegion NetworkTechnology Relationship.
+
+2.Delete Cloud site:
+
+* Path:/v1/cloud-region/{cloud-region-id}/{cloud-owner}
+
+* Here we can delete Cloud site by cloud region id
+
+3.Update Cloud site:
+
+* Path:/v1/cloud-region/{cloud-region-id}/{cloud-owner}
+
+* Here we can update Cloud site by cloud region id
+
+Create Tenant in Cloud:
+++++++++++++++++++++++++
+
+Path: http://host:port/vnfs/rest/v1/tenants
+
+Method Type: POST
+
+Request Body:
+*************
+
+{
+"cloudSiteId": "DAN",
+"tenantName":"RAA_1",
+"failIfExists": true,
+"msoRequest": {
+"requestId": "ra1",
+"serviceInstanceId":"sa1"
+}
+}
+
+RESPONSE:
+**********
+
+{
+
+"cloudSiteId": "DAN",
+"tenantId": "128e10b9996d43a7874f19bbc4eb6749",
+"tenantCreated": true,
+"tenantRollback": {
+"tenantId": "128e10b9996d43a7874f19bbc4eb6749",
+"cloudId": "DAN", // RAA? cloudId instead of cloudSiteId
+"tenantCreated": true,
+"msoRequest": {
+"requestId": "ra1",
+"serviceInstanceId": "sa1"
+
+}
+}
+}
+
+Code Flow:
+
+* Call to MSO createTenant adapter then call to catalog db for cloud site info and from cloud site get IdentityServerType.
+* based on Cloud IdentityServerType it returns ORM or KEYSTONE Utils
+* Query for a tenant with the specified name in the given cloud. If the tenant exists, return an MsoTenant object. If not, return null.
+* Create a tenant with the specified name in the given cloud. If the tenant already exists, an Exception will be thrown. The MSO User will also be added to the "member" list of the new tenant to perform subsequent Nova/Heat commands in the tenant. If the MSO User association fails, the entire transaction will be rolled back.
+
+TaskServices
+++++++++++++++
+**1. CreateInventory**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryCreate.png
+
+Code Flow:
+
+* Get cloud site using cloud region id from catalog db.
+
+* Instantiate heat bridge client by passing required values.
+
+* Authenticate heat bridge client.
+
+* If authentication is success we are getting all stack resources(openstack servers. servers contains openstack images and flavours.)
+
+* From stack resources we are getting osServers/ compute resources.
+
+* CreatePserversAndPinterfacesIfNotPresentInAai --Transform Openstack Server object to AAI Pserver object. create pserver in AAI if it is not exist. and get openstackresource id's / ports -- transform ports to pinterface Object in AAI.
+
+* After extract osimages and os flavours from osservers.
+
+* After that transform osimages to AAI images and osflavours to AAI flavors and add to AAI.
+
+* Create Vservers in AAI and make relationships to AAI image, AAI flavor, AAI pserver, vf-module.
+
+* Add Vservers and Linterfaces to AAI--Transform port to Linterface and for that port Get Ip addresses and updateLInterfaceIps and updateLInterfaceVlan.
+
+* Finally update AAI.
+
+**2. AuditCreateStack**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryAddAudit.png
+
+Code Flow:
+
+* First we are capturing entry timestamp, MSO REQUESTID, Servicename/topic name,partnername as openstack adapter, invocation id is generating one random uuid.
+
+* After that getting auditInventory details from externalTask object
+
+* From auditInventory object we are getting cloud region,clowd owner,tenant id, heatstack name.these details we are passing to get AAIObjectAuditList.
+
+* Use cloudRegion, tenantId, heatStackName to get resources from Heat client.
+
+* To get resources we need heat client it means getting keystone url and token.
+
+* Get keystone url based on server type(keystone/keystonev3)
+
+* From resources object we are getting novaResources and resource groups and neutronPortDetails.
+
+* Create VserverSet by passing resources, novaResources, neutronPortDetails and setting up servers with ports to Set of Servers.
+
+* From resource groups we are getting Link(stackLink) from that link we are extracting resource path .if path is present we are Fetching nested Resource Stack Information.
+
+* audit all vservers,l-interfaces and sub l-interfaces. and checking in these vservers , l-interfaces and sub interfaces are existed or not in AAI.
+
+* If AAIObjectAuditList is present then we are setting audit type as create and Heat stack name to AAIObjectAuditList.
+
+* If Audit create success putting in variable to complete external task other wise sending exception.
+
+* If retrycount=1 sending error as retrycount exhausted.
+
+**3. AuditQueryStack**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryQueryAudit.png
+
+
+Code Flow:
+
+* Get AuditInventory details from external task.
+
+* Get AAIObjectAuditList from auditHeatStack by passing these parametersauditInventory.getCloudRegion(),auditInventory.getCloudOwner(), auditInventory.getTenantId(), auditInventory.getHeatStackName().
+
+* Fetching Top Level Stack Information.i.e get all the heat model resources.
+
+* From heat model resources get all OS::Nova::Servers and OS::Heat::ResourceGroups and neutronPortDetails.
+
+* Once u got all the stack info u create vserverset and add that vserverset to AAIObjectAuditList.
+
+* After add AAIObjectAuditList to requestdb if it is not exist in requestdb.
+
+* If it is success complete the external task.
+
+**4. AuditDeleteStack**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryDeleteAudit.png
+
+Code Flow:
+
+* Get AuditInventory details from external task
+
+* GetStackDataFromRequestDb usiing AuditInventory details.
+
+* Get RequestProcessingData from requestdb using auditInventory.getVfModuleId(),auditInventory.getHeatStackName(), "AuditStackData".
+
+* From RequestProcessingData get AAIObjectAuditList.
+
+* If AAIObjectAuditList is empty check vservers is exist or not in AAI and set that result as setDoesObjectExist(true/false).
+
+* Else Auditing Vservers based on vf module relationships--i.e based on genericVnfId and vfModuleName get all the vservers and create AAIObject and set setDoesObjectExist(true) and set that object to list.
+
+* After that set audit type as delete and heatstackname and check that audit create success or not.
+
+* If it is success complete the external task.
+
+**5. DeleteInventory**
+
+Flow Diagram:
+
+.. image :: ../images/DeleteInventory.png
+
+
+Code Flow:
+
+* Get CloudInformation from external task.
+
+* First get CloudSite details from catalog db by using regionid.
+
+* From CloudSite get CloudIdentity details.
+
+* Create a heatbridgeclient. and authenticate the heatbridge.
+
+* After that delete the VFmodule data using vnfid and vf moduleid.
+
+* Once delete success complete the external task.
+
+**6. StackService**
+
+Flow Diagram:
+
+.. image :: ../images/OpenstackAdapterInvoke.png
+
+
+Code Flow:
+
+* From external task getting openstackAdapterTaskRequest and adding to string(xmlRequest).
+
+* From xmlrequest we are getting requestType.
+
+1. If requestType is createVolumeGroupRequest then we are creating volume group.
+
+* Marshalling xmlRequest to CreateVolumeGroupRequest.
+
+* From CreateVolumeGroupRequest getting completeVnfVfModuleType.
+
+* After that we are creating vf module by passing required paremeters.
+
+* If request type Start with X then we are orchestrating a VNF - *NOT* a module!
+
+* RequestType start with Volume then then we are sending true as volume request.
+
+* Creating a VnfRollback object by passing required parameters.
+
+* If nestedStackId is not null we are getting nested heat stack(stack information).
+
+* If nested heat stack is not null we are getting that output and storing into nestedVolumeOutputs object.
+
+* If nestedBaseStackId is not null we are getting nestedBaseHeatStack information and setting output to nestedBaseHeatStack.
+
+* If modelCustomizationUuid is available then with that mcu we are getting VFModuleCustomization(vfmc);
+
+* If we get VFModuleCustomization then we are extracting VfModule.
+
+* If vf version is not null then we will get vnfresource by passing vnftype and vnfversion.
+
+* By here - we would have either a vf or vnfResource.
+
+* If vf module is not null we are geting vnfresource from vf and from this vnfresource we are getting minversionvnf and maxversionvnf.
+
+* If minversionvnf and maxversionvnf are not null we are checking cloudConfig is null or not, if cloudConfig is not null then we are getting cloud site intormation by passing cloud site id. once we get the cloud site details we are getting min and max cloud site versions.
+
+* By the time we get here - heatTemplateId and heatEnvtId should be populated (or null)
+
+* If it is old way we will get heatTemplate directly. else if vf module is not null then
+* If it is a volume request then we will get volumeheattemplate and volumeheatenvironment.
+* If it is not a volume request then we will get ModuleHeatTemplate and HeatEnvironment.
+
+* Once we get heat templates we are getting nestedtemplates.
+
+* Also add the files: for any get_files associated with this vnf_resource_id
+
+* Add ability to turn on adding get_files with volume requests (by property).
+
+* If it is not a volume request get heat files from vf module.
+
+* CheckRequiredParameters in MsoVnfAdapterImpl.CHECK_REQD_PARAMS.
+
+* Parse envt entries to see if reqd parameter is there (before used a simple grep
+
+* Only submit to openstack the parameters in the envt that are in the heat template
+
+* Convert what we got as inputs (Map<String, String>) to a Map<String, Object> - where the object matches the param type identified in the template This will also not copy over params that aren't identified in the template
+
+* Now simply add the outputs as we received them - no need to convert to string
+
+* Add in the volume stack outputs if applicable
+
+* Get all heat template parameters and add to list.
+
+* Check for missing parameters null or not.if no missing parameters we can proceed for next step.
+
+* Next create stack with all required values.
+
+* After creating add heat stackname to vfrollback and copy heatstack outputs to outputs value. so now vf module is created successfully.
+
+* After sending the response to create volume group.once it is created that response we are setting to VolumeGroup response object.
+
+2. If requestType is createVfModuleRequest then we are creating VfModule.
+
+* Marshalling xmlRequest to CreateVolumeGroupRequest.
+
+* From CreateVolumeGroupRequest getting completeVnfVfModuleType.
+
+* After that we are creating vf module by passing required paremeters.
+
+* If request type Start with X then we are orchestrating a VNF - *NOT* a module!
+
+* RequestType start with Volume then then we are sending true as volume request.
+
+* Creating a VnfRollback object by passing required parameters.
+
+* If nestedStackId is not null we are getting nested heat stack(stack information).
+
+* If nested heat stack is not null we are getting that output and storing into nestedVolumeOutputs object.
+
+* If nestedBaseStackId is not null we are getting nestedBaseHeatStack information and setting output to nestedBaseHeatStack.
+
+* If modelCustomizationUuid is available then with that mcu we are getting VFModuleCustomization(vfmc);
+
+* If we get VFModuleCustomization then we are extracting VfModule.
+
+* If vf version is not null then we will get vnfresource by passing vnftype and vnfversion.
+
+* By here - we would have either a vf or vnfResource.
+
+* If vf module is not null we are geting vnfresource from vf and from this vnfresource we are getting minversionvnf and maxversionvnf.
+
+* If minversionvnf and maxversionvnf are not null we are checking cloudConfig is null or not, if cloudConfig is not null then we are getting cloud site intormation by passing cloud site id. once we get the cloud site details we are getting min and max cloud site versions.
+
+* By the time we get here - heatTemplateId and heatEnvtId should be populated (or null)
+
+* If it is old way we will get heatTemplate directly. else if vf module is not null then
+
+* If it is a volume request then we will get volumeheattemplate and volumeheatenvironment.
+
+* If it is not a volume request then we will get ModuleHeatTemplate and HeatEnvironment.
+
+* Once we get heat templates we are getting nestedtemplates.
+
+* Also add the files: for any get_files associated with this vnf_resource_id
+
+* Add ability to turn on adding get_files with volume requests (by property).
+
+* If it is not a volume request get heat files from vf module.
+
+* CheckRequiredParameters in MsoVnfAdapterImpl.CHECK_REQD_PARAMS.
+
+* Parse envt entries to see if reqd parameter is there (before used a simple grep
+
+* Only submit to openstack the parameters in the envt that are in the heat template
+
+* Convert what we got as inputs (Map<String, String>) to a Map<String, Object> - where the object matches the param type identified in the template This will also not copy over params that aren't identified in the template
+
+* Now simply add the outputs as we received them - no need to convert to string
+
+* Add in the volume stack outputs if applicable
+
+* Get all heat template parameters and add to list.
+
+* Check for missing parameters null or not.if no missing parameters we can proceed for next step.
+
+* Next create stack with all required values.
+
+* After creating add heat stackname to vfrollback and copy heatstack outputs to outputs value. so now vf module is created successfully.
+
+3. If requestType is deleteVfModuleRequest then we are deleting VfModule .
+
+* Get stackinfo using msoHeatUtils by passing cloudSiteId, cloudOwner, tenantId, vnfName parameters.
+
+* After that using modelCustomizationUuid we are getting VFModuleCustomizaiton--VFModule--heattemplate.
+
+* After that we are callling msoHeatUtils.deleteStack to delete StackInfo once it deletes we are updating status as deleted using msoHeatUtils.updateResourceStatus.
+
+4. If requestType is deleteVolumeGroupRequest then we are deleting volume group.
+
+* Making DeleteVolumeGroupRequest by Unmarshalling xml request.
+
+* Getting stack information by passing stackName, cloudSiteId, tenantId.
+
+* If current stack is null then we confirm that heat status not found.
+
+* If current stack is not null then we are deleting the stack.
+
+* Once volumegroup is deleted we are setting the response to perticular response class.
+
+5. If requestType is createNetworkRequest then we are creating network.
+
+* Making CreateNetworkRequest by Unmarshalling xmlrequest.
+
+* Check request is contrailRequest or not if it is contrailRequest we are setting shared,external,routeTargets,fqdns,routeTable values else we are setting physicalNetworkName and vlans.
+
+* Now all the above required values we are passing to create network.
+
+* Build a default NetworkRollback object (if no actions performed).
+
+* Getting the cloud site by passing cloudsite id.
+
+* After we are doing a network check and Retrieve the Network Resource definition.
+
+* If modelCustomizationUuid null and networkType is not null based on networkType we are getting Network Resource.
+
+* If modelCustomizationUuid not null then based on modelCustomizationUuid we are getting NetworkResourceCustomization and from that we are getting Network Resource.
+
+* If NetworkResourceCustomization is null then based on modelCustomizationUuid we are getting CollectionNetworkResourceCustomization and from that we are getting Network Resource.
+
+* Even though Network Resource is null we are sending error Unable to get network resource with NetworkType.
+
+* From the network resource we are extracting mode and network type.
+
+* All Networks are orchestrated via HEAT or Neutron if it is other than that we are sending error.
+
+* After that we are checking network resorce min and max versions with cloud site version if version is not supported throwing error.
+
+* After that validating the network parameters that if any parameter is missing.
+
+* Once we Retrieve the Network Resource we are getting heat template and NetworkType from that.
+
+* From the heat template we are getting template and checking that template contains os3nw if it is contains making flag is true.
+
+* First, look up to see if the Network already exists (by name).For HEAT orchestration of networks, the stack name will always match the network name
+
+* If stack is already exist with the network name throw an error.
+
+* After that from stackinfo get network id and network fqdn and get outputs from Stackinfo.
+
+* After that get subnetIdMap based on one subnet_id output or multiples subnet_%aaid% outputs from Stackinfo outputs.
+
+* After that update the updateResourceStatus as exits in requestdb.
+
+* Now we are Ready to deploy the new Network and Build the common set of HEAT template parameters
+
+* Validate (and update) the input parameters against the DB definition
+
+* Shouldn't happen unless DB config is wrong, since all networks use same inputs and inputs were already validated.
+
+* If subnets are not null and template is os3template then mergesubnetsAIC3.
+
+* If subnets are not null and template is not os3template then merge subnets.
+
+* If policyFqdns are not null & os3template true then mergePolicyRefs.
+
+* After that deploy the network stack-- create stack and once stack is created save into stackinfo.
+
+* For Heat-based orchestration, the MSO-tracked network ID is the heat stack, and the neutronNetworkId is the network UUID returned in stack outputs.
+
+* After update the resource status like network created successfully.
+
+* After set response to CreateNetworkResponse object.
+
+
+6. If requestType is deleteNetworkRequest then we are deleting network.
+
+* Form a DeleteNetworkRequest by unmarshlling Xml request.
+
+* check for mandatory fields networkId, cloudSiteId, tenantId.
+
+* If it is there Retrieve the Network Resource definition.
+
+* After that get networkResource.from networkResource get heat template.
+
+* After that delete stackinfo udpate resource status as deleted.
+
+7. If requestType is updateNetworkRequest then we are updating Network.
+
+* Make UpdateNetworkRequest by unmarshalling xmlRequest.
+
+* Check the params contains key shared and external if it is contains get that shared and external keys.
+
+* Check the request is ContrailRequest or not, if it is ContrailRequest then get routeTargets , fqdns, routeTable from the actual request.
+
+* If it is not ContrailRequest then get the ProviderVlanNetwork details like physicalNetworkName and vlans.
+
+* Params to update network-req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), physicalNetworkName,vlans, routeTargets, shared, external, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), subnetIdMap, networkRollback.
+
+* Update Network adapter with Network using networkName, networkType,cloudSiteId, tenantId.
+
+* Capture execution time for metrics.
+
+* Build a default rollback object (no actions performed)
+
+* Get cloud site details from catalog db using cloud site id.
+
+* If cloud site is not present send the error message like CloudSite does not exist in MSO Configuration.
+
+* Getting the cloud site by passing cloudsite id.
+
+* After we are doing a network check and Retrieve the Network Resource definition.
+
+* If modelCustomizationUuid null and networkType is not null based on networkType we are getting Network Resource.
+
+* If modelCustomizationUuid not null then based on modelCustomizationUuid we are getting NetworkResourceCustomization and from that we are getting Network Resource.
+
+* If NetworkResourceCustomization is null then based on modelCustomizationUuid we are getting CollectionNetworkResourceCustomization and from that we are getting Network Resource.
+
+* Even though Network Resource is null we are sending error Unable to get network resource with NetworkType.
+
+* From the network resource we are extracting mode and network type.
+
+* All Networks are orchestrated via HEAT or Neutron if it is other than that we are sending error.
+
+* After that we are checking network resorce min and max versions with cloud site version if version is not supported throwing error.
+
+* After that validating the network parameters that if any parameter is missing.
+
+* Once we Retrieve the Network Resource we are getting heat template and NetworkType from that.
+
+* Use an MsoNeutronUtils for all Neutron commands
+
+* If Orchestaration mode is NEUTRON Verify that the Network exists and For Neutron-based orchestration, the networkId is the Neutron Network UUID.
+
+* Get NetworkInfo from cloud site using networkId, tenantId, cloudSiteId as params.
+
+* If NetworkInfo is null then throw the error message as Network is does not exist.
+
+* Update the network in cloud site which is in catalog db using cloudSiteId,tenantId,networkId, neutronNetworkType, physicalNetworkName, vlans as params.
+
+* Add the network ID and previously queried vlans to the rollback object.
+
+* Save previous parameters such as NetworkName,PhysicalNetwork,Vlans to the NetworkRollback.
+
+* If Orchestaration mode is HEAT then First, look up to see that the Network already exists. For Heat-based orchestration, the networkId is the network Stack ID.
+
+* Get StackInfo by querystack using cloudSiteId, CLOUD_OWNER, tenantId, networkName.
+
+* If StackInfo is null throw error as Network not found else continue the flow.
+
+* Get the previous parameters such as previousNetworkName and previousPhysicalNetwork for rollback from StackInfo.
+
+* Get the previous vlans from the heat params and Update Stack with Previous VLANS.
+
+* Now we are Ready to deploy the updated Network via Heat.
+
+* Get the HeatTemplate from NetworkResource and now we got HEAT Template from DB.
+
+* Now get the OS::ContrailV2::VirtualNetwork property from property file , if template contains os3nw set flag as true.
+
+* Build the common set of HEAT template parameters such as neutronNetworkType, networkName, physicalNetworkName, vlans, routeTargets, shared, external, os3template.
+
+* Validate and update the input parameters against the DB definition and Shouldn't happen unless DB config is wrong, since all networks use same inputs.
+
+* If subnets are not null and template is os3template then mergesubnetsAIC3.
+
+* If subnets are not null and template is not os3template then merge subnets.
+
+* If policyFqdns are not null & os3template true then mergePolicyRefs.
+
+* If routeTableFqdns are not null os3template not null then mergeRouteTableRefs using routeTableFqdns, stackParams as params.
+
+* Get outputs from StackInfo and if key is contains subnet and os3template not null then one subnet output expected else multiples subnet outputs allowed.
+
+* Reach this point if createStack is successful.Populate remaining rollback info and response parameters and save previous parameters.
+
+* Now Network successfully updated via HEAT.
+
+8. If requestType is rollbackNetworkRequest then we are doing rollbackNetwork.
+
+* Make RollbackNetworkRequest by unmarshalling xmlRequest.
+
+* Get NetworkRollback from RollbackNetworkRequest.
+
+* If pollForCompletion is null then set flag as true.
+
+* Get the elements of the VnfRollback object for easier access.
+
+* ROLLBACK Network using networkId, cloudSiteId, tenantId.
+
+* If NetworkCreated then use tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, timeoutMinutes params to delete stack.
+
+* Once deletion is success set the response to RollbackNetworkResponse.
+
+* Once task stack service is success set the status completed for the external task.
+
+
+**7. PollService**
+
+Flow Diagram:
+
+.. image :: ../images/OpenstackAdapterPoller.png
+
+
+Code Flow:
+
+* Get openstackAdapterTaskRequest as xmlRequest from the the external task.
+
+* Get requestType from the xmlRequest.
+
+1. If request type is createVolumeGroupRequest then Execute External Task Rollback Service for Create Volume Group.
+
+* Create CreateVolumeGroupRequest by unmarshalling xmlRequest.
+
+* Use CloudSiteId, CloudOwner, TenantId,VolumeGroupName, MsoRequest ,pollStackStatus as params to delete vnf.
+
+* Call to openstack to delete vnf if it is success nothing to return if it is failure return failure exception.
+
+* Once it is success set the boolean flags pollRollbackStatus and status as true.
+
+2. If request type is createVfModuleRequest then Execute External Task Rollback Service for Create Vf Module.
+
+* Create CreateVfModuleRequest by unmarshalling xmlRequest.
+
+* Use CloudSiteId, CloudOwner, TenantId,VfModuleName, VnfId, VfModuleId, ModelCustomizationUuid,MsoRequest ,Holder as params to delete vf module.
+
+* Call to openstack to get the stack outputs.
+
+* If modelCustomizationUuid is not null then use as a param to get the VfModuleCustomization and from VfModuleCustomization get the vf module details.
+
+* Use tenantId, cloudOwner, cloudSiteId, vnfName, pollForCompletion, timeoutMinutes as params to delete the stack .once it is success update the resources.
+
+* Once it is success set the boolean flags pollRollbackStatus and status as true.
+
+3. If requestType is deleteVfModuleRequest then Execute External Task Poll Service for Delete Vf Module.
+
+* Create DeleteVfModuleRequest by unmarshalling xmlRequest.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+
+4. If requestType is deleteVolumeGroupRequest then Execute Execute External Task Poll Service for Delete Volume Group.
+
+* Create DeleteVfModuleRequest by unmarshalling xmlRequest.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+5. If requestType is deleteNetworkRequest then Execute External Task Poll Service for Delete Network.
+
+* Create DeleteVfModuleRequest by unmarshalling xmlRequest.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+6. If requestType is createNetworkRequest then get the PollRollbackStatus from the external task.
+
+* If pollRollbackStatus is true then Execute External Task Poll Service for Rollback Create Network.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+* If pollRollbackStatus is false then Execute External Task Poll Service for Create Network.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is CREATE_COMPLETE then Stack Creation completed successfully.
+
+7. If requestType is createNetworkRequest then Execute External Task Rollback Service for Create Network.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is UPDATE_COMPLETE then Stack Updation completed successfully.
+
+* Once task stack service is success set the status completed for the external task.
+
+**8. RollbackService**
+
+Flow Diagram:
+
+.. image :: ../images/OpenstackAdapterRollback.png
+
+
+Code Flow:
+
+* Get openstackAdapterTaskRequest as xmlRequest from the the external task.
+
+* Get requestType from the xmlRequest.
+
+1. If request type is createVolumeGroupRequest then Execute External Task Rollback Service for Create Volume Group.
+
+* Making DeleteVolumeGroupRequest by Unmarshalling xml request.
+
+* Getting stack information by passing stackName, cloudSiteId, tenantId.
+
+* If current stack is null then we confirm that heat status not found.
+
+* If current stack is not null then we are deleting the stack.
+
+* Once volumegroup is deleted we are setting the response to perticular response class.
+
+2. If request type is createVfModuleRequest then Execute External Task Rollback Service for Create Vf Module.
+
+* Get stackinfo using msoHeatUtils by passing cloudSiteId, cloudOwner, tenantId, vnfName parameters.
+
+* After that using modelCustomizationUuid we are getting VFModuleCustomizaiton--VFModule--heattemplate.
+
+* After that we are callling msoHeatUtils.deleteStack to delete StackInfo once it deletes we are updating status as deleted using msoHeatUtils.updateResourceStatus.
+
+* Once it is success set the boolean flags pollRollbackStatus and status as true.
+
+3. If request type is createNetworkRequest then Execute External Task Rollback Service for Create Network.
+
+* Form a DeleteNetworkRequest by unmarshlling Xml request.
+
+* Check for mandatory fields networkId, cloudSiteId, tenantId.
+
+* If it is there Retrieve the Network Resource definition.
+
+* After that get networkResource.from networkResource get heat template.
+
+* After that delete stackinfo udpate resource status as deleted.
+
+* Once task stack service is success set the status completed for the external task.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/developer_info/developer_information.rst b/docs/developer_info/developer_information.rst
index 570861345c..1b9e83b840 100644
--- a/docs/developer_info/developer_information.rst
+++ b/docs/developer_info/developer_information.rst
@@ -20,5 +20,6 @@ SO Developer Information
BPMN_Subprocess_Process_Flows.rst
BPMN_Project_Deployment_Strategy.rst
BPMN-INFRA_Workflow_Understanding.rst
+ Mso_Openstack_Adapter.rst
instantiate/index.rst
FAQs.rst
diff --git a/docs/images/DeleteInventory.png b/docs/images/DeleteInventory.png
new file mode 100644
index 0000000000..0fd6629db8
--- /dev/null
+++ b/docs/images/DeleteInventory.png
Binary files differ
diff --git a/docs/images/InventoryAddAudit.png b/docs/images/InventoryAddAudit.png
new file mode 100644
index 0000000000..9e61c15804
--- /dev/null
+++ b/docs/images/InventoryAddAudit.png
Binary files differ
diff --git a/docs/images/InventoryCreate.png b/docs/images/InventoryCreate.png
new file mode 100644
index 0000000000..7df732f1d1
--- /dev/null
+++ b/docs/images/InventoryCreate.png
Binary files differ
diff --git a/docs/images/InventoryDeleteAudit.png b/docs/images/InventoryDeleteAudit.png
new file mode 100644
index 0000000000..f2f08bf52b
--- /dev/null
+++ b/docs/images/InventoryDeleteAudit.png
Binary files differ
diff --git a/docs/images/InventoryQueryAudit.png b/docs/images/InventoryQueryAudit.png
new file mode 100644
index 0000000000..34f6cad128
--- /dev/null
+++ b/docs/images/InventoryQueryAudit.png
Binary files differ
diff --git a/docs/images/OpenstackAdapterInvoke.png b/docs/images/OpenstackAdapterInvoke.png
new file mode 100644
index 0000000000..998c4721b0
--- /dev/null
+++ b/docs/images/OpenstackAdapterInvoke.png
Binary files differ
diff --git a/docs/images/OpenstackAdapterPoller.png b/docs/images/OpenstackAdapterPoller.png
new file mode 100644
index 0000000000..e95bede9a2
--- /dev/null
+++ b/docs/images/OpenstackAdapterPoller.png
Binary files differ
diff --git a/docs/images/OpenstackAdapterRollback.png b/docs/images/OpenstackAdapterRollback.png
new file mode 100644
index 0000000000..1e554263b0
--- /dev/null
+++ b/docs/images/OpenstackAdapterRollback.png
Binary files differ
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json
index 8257e6ba22..8a7eb9d006 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json
@@ -75,7 +75,8 @@
},
"retirementDate":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
}
}
}
@@ -9667,7 +9668,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstantiationLevelId":{
"description":"An identifier that is unique within a NS descriptor. Representation: string of variable length.\n",
@@ -10745,7 +10747,8 @@
},
"scaleTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
}
}
},
@@ -13113,7 +13116,8 @@
},
"updateTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
}
}
},
@@ -15175,7 +15179,8 @@
},
"statusEnteredTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstanceId":{
"description":"An identifier with the intention of being globally unique.\n",
@@ -15194,7 +15199,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"isAutomaticInvocation":{
"description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
@@ -15202,14 +15208,7 @@
},
"operationParams":{
"description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
- "type":"string",
- "enum":[
- "INSTANTIATE",
- "SCALE",
- "UPDATE",
- "HEAL",
- "TERMINATE"
- ]
+ "type":"object"
},
"isCancelPending":{
"description":"If the LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",
@@ -16396,7 +16395,8 @@
},
"statusEnteredTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstanceId":{
"description":"An identifier with the intention of being globally unique.\n",
@@ -16415,7 +16415,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"isAutomaticInvocation":{
"description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
@@ -16423,14 +16424,7 @@
},
"operationParams":{
"description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
- "type":"string",
- "enum":[
- "INSTANTIATE",
- "SCALE",
- "UPDATE",
- "HEAL",
- "TERMINATE"
- ]
+ "type":"object"
},
"isCancelPending":{
"description":"If the LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",
@@ -19521,7 +19515,8 @@
},
"statusEnteredTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstanceId":{
"description":"An identifier with the intention of being globally unique.\n",
@@ -19540,7 +19535,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"isAutomaticInvocation":{
"description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
@@ -19548,14 +19544,7 @@
},
"operationParams":{
"description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
- "type":"string",
- "enum":[
- "INSTANTIATE",
- "SCALE",
- "UPDATE",
- "HEAL",
- "TERMINATE"
- ]
+ "type":"object"
},
"isCancelPending":{
"description":"If the LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",