summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author’zhaoyh6‘ <zhaoyh6@asiainfo.com>2022-03-29 14:52:13 +0800
committer’zhaoyh6‘ <zhaoyh6@asiainfo.com>2022-03-29 14:52:22 +0800
commit515c32f3d27cc2ce99195f65c952dedd3bacd856 (patch)
tree1e016094e0cca6db3872b8100d59305800ce5df8
parent346b023cda770a75b85828a2a4ccb51ceb81b3e6 (diff)
feat: modify create ccvpn instance function.
Issue-ID: REQ-1075 Signed-off-by: ’zhaoyh6‘ <zhaoyh6@asiainfo.com> Change-Id: I69ce95b058b653a7ed2287681f25253cc28bd6d5
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/bean/intent/CCVPNInstance.java22
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/IntentController.java4
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java4
-rw-r--r--standalone/src/main/assembly/resources/dbscripts/postgres/uui_create_table.sql4
4 files changed, 33 insertions, 1 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/intent/CCVPNInstance.java b/server/src/main/java/org/onap/usecaseui/server/bean/intent/CCVPNInstance.java
index 50e5ac39..55eb84a2 100644
--- a/server/src/main/java/org/onap/usecaseui/server/bean/intent/CCVPNInstance.java
+++ b/server/src/main/java/org/onap/usecaseui/server/bean/intent/CCVPNInstance.java
@@ -62,6 +62,12 @@ public class CCVPNInstance implements Serializable {
@Column(name = "delete_state")
private int deleteState;
+ @Column(name = "protection_cloud_point_name")
+ private String protectionCloudPointName;
+
+ @Column(name = "protection_type")
+ private String protectionType;
+
public CCVPNInstance() {
}
@@ -169,4 +175,20 @@ public class CCVPNInstance implements Serializable {
public void setProtectStatus(int protectStatus) {
this.protectStatus = protectStatus;
}
+
+ public String getProtectionCloudPointName() {
+ return protectionCloudPointName;
+ }
+
+ public void setProtectionCloudPointName(String protectionCloudPointName) {
+ this.protectionCloudPointName = protectionCloudPointName;
+ }
+
+ public String getProtectionType() {
+ return protectionType;
+ }
+
+ public void setProtectionType(String protectionType) {
+ this.protectionType = protectionType;
+ }
} \ No newline at end of file
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/IntentController.java b/server/src/main/java/org/onap/usecaseui/server/controller/IntentController.java
index b8d63f44..e4d66767 100644
--- a/server/src/main/java/org/onap/usecaseui/server/controller/IntentController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/IntentController.java
@@ -435,6 +435,10 @@ public class IntentController {
instance.setAccessPointOneBandWidth(accessPointOneBandWidth);
instance.setStatus("0");
instance.setProtectStatus(protectStatus?1:0);
+ if (protectStatus) {
+ instance.setProtectionType("1+1");
+ instance.setProtectionCloudPointName("tranportEp_dst_ID_123_4");
+ }
int flag = intentInstanceService.createCCVPNInstance(instance);
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java
index b62f3aa9..c703953f 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java
@@ -219,6 +219,10 @@ public class IntentInstanceServiceImpl implements IntentInstanceService {
connectionLink.put("transportEndpointA", instance.getAccessPointOneName());
connectionLink.put("transportEndpointB", instance.getCloudPointName());
connectionLinks.add(connectionLink);
+ if (instance.getProtectStatus() == 1) {
+ sla.put("protectionType", instance.getProtectionType());
+ connectionLink.put("transportEndpointBProtection", instance.getProtectionCloudPointName());
+ }
transportNetwork.put("sla", sla);
transportNetwork.put("connectionLinks", connectionLinks);
transportNetworks.add(transportNetwork);
diff --git a/standalone/src/main/assembly/resources/dbscripts/postgres/uui_create_table.sql b/standalone/src/main/assembly/resources/dbscripts/postgres/uui_create_table.sql
index 9e45d5b0..4e43e20d 100644
--- a/standalone/src/main/assembly/resources/dbscripts/postgres/uui_create_table.sql
+++ b/standalone/src/main/assembly/resources/dbscripts/postgres/uui_create_table.sql
@@ -183,7 +183,9 @@ CREATE TABLE ccvpn_instance
access_point_one_band_width integer,
line_num varchar(64),
delete_state integer default 0,
- protect_status integer default 0
+ protect_status integer default 0,
+ protection_cloud_point_name varchar(255),
+ protection_type varchar(255)
);
-- ----------------------------