From 754851249b5722222a84e5a821f6edea095e72e7 Mon Sep 17 00:00:00 2001 From: Steven Saunders Date: Wed, 16 Dec 2015 14:31:40 -0700 Subject: make create, delete, get work with new topology based REST calls Change-Id: Iad6fa28971ad61003d34ed38ab2e2d8647dc31bd Signed-off-by: Steven Saunders --- .../com/cablelabs/vcpe/uni/unibase/model/Uni.java | 55 +++++++++++++++------- 1 file changed, 39 insertions(+), 16 deletions(-) (limited to 'uni/unibase/src/main/java/com/cablelabs/vcpe/uni/unibase/model/Uni.java') diff --git a/uni/unibase/src/main/java/com/cablelabs/vcpe/uni/unibase/model/Uni.java b/uni/unibase/src/main/java/com/cablelabs/vcpe/uni/unibase/model/Uni.java index cec4d80..0edf3db 100644 --- a/uni/unibase/src/main/java/com/cablelabs/vcpe/uni/unibase/model/Uni.java +++ b/uni/unibase/src/main/java/com/cablelabs/vcpe/uni/unibase/model/Uni.java @@ -126,22 +126,45 @@ public class Uni public String toJson() { - String json = "{\n"+ - " \"uni\":\n"+ - " {\n"+ - " \"uni:id\": \""+ this.getId() +"\",\n"+ - " \"speed\":\n" + - " {\n" + - " \"" + this.getSpeed() + "\": "+"\"1\"\n"+ - " },\n"+ - " \"uni:mac-layer\": \""+ this.getMacLayer() +"\",\n"+ - " \"uni:physical-medium\": \""+ this.getPhysicalMedium() +"\",\n"+ - " \"uni:mtu-size\": \""+ this.getMtuSize() +"\",\n"+ - " \"uni:type\": \"\",\n"+ - " \"uni:mac-address\": \""+ this.getMacAddress() +"\",\n"+ - " \"uni:ip-address\": \""+ this.getIpAddress() +"\",\n"+ - " \"uni:mode\": \""+ this.getMode() +"\"\n"+ - " }\n"+ + /* + { + "network-topology:node": [ + { + "node-id": "uni1", + "speed": { + "speed-1G": 1 + }, + "uni:mac-layer": "IEEE 802.3-2005", + "uni:physical-medium": "UNI TypeFull Duplex 2 Physical Interface", + "uni:mtu-size": 0, + "uni:type": "", + "uni:mac-address": "b8:27:eb:c9:a9:66", + "uni:ip-address": "10.36.0.21", + "uni:mode": "Full Duplex" + } + ] + } + */ + + String json = + "{\n"+ + " \"network-topology:node\":\n" + + " [" + + " {\n"+ + " \"node-id\": \""+ this.getId() +"\",\n"+ + " \"speed\":\n" + + " {\n" + + " \"" + this.getSpeed() + "\": "+"\"1\"\n"+ + " },\n"+ + " \"uni:mac-layer\": \""+ this.getMacLayer() +"\",\n"+ + " \"uni:physical-medium\": \""+ this.getPhysicalMedium() +"\",\n"+ + " \"uni:mtu-size\": \""+ this.getMtuSize() +"\",\n"+ + " \"uni:type\": \"\",\n"+ + " \"uni:mac-address\": \""+ this.getMacAddress() +"\",\n"+ + " \"uni:ip-address\": \""+ this.getIpAddress() +"\",\n"+ + " \"uni:mode\": \""+ this.getMode() +"\"\n"+ + " }\n"+ + " ]" + "}"; return json; -- cgit 1.2.3-korg