diff options
author | Keguang He <hekeguang@chinamobile.com> | 2022-03-29 07:00:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-03-29 07:00:10 +0000 |
commit | e9842acf7658dcf7e5e95465707fa440ca1f6eef (patch) | |
tree | 871e9fb491dfd3efcd806aafa218b9292f57caef | |
parent | 15215ebc054b91571f4daaa324ec90fc9aeba363 (diff) | |
parent | 515c32f3d27cc2ce99195f65c952dedd3bacd856 (diff) |
Merge "feat: modify create ccvpn instance function."
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) ); -- ---------------------------- |