[SEBA-226] Addis IpAddress and NasId to sadis response
Change-Id: I10dcbcd2be46aca0bbebf5c5af53cc1084517f97
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..723ef36
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea
\ No newline at end of file
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..65c0161
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.opencord.org
+port=29418
+project=sadis-server.git
+defaultremote=origin
diff --git a/handlers.go b/handlers.go
index ef2e5af..b82b6fc 100644
--- a/handlers.go
+++ b/handlers.go
@@ -15,6 +15,7 @@
import (
"encoding/json"
+ "fmt"
"net/http"
"strconv"
@@ -76,14 +77,19 @@
}
+ fmt.Println(devices)
+
for _, device := range devices.OltDevices {
devID := device.Host + ":" + strconv.Itoa(device.Port)
if devID == sadisRequestID {
log.Infof("Found OLT device with ID %s", devID)
+ log.Debugf("ID: %s, Uplink: %s, IPAddress: %s, NasID: %s", devID, toInt(device.Uplink), device.Host, device.NasID)
sadisDevice := sadisDevice{
ID: devID,
Uplink: toInt(device.Uplink),
HardwareID: "de:ad:be:ef:ba:11", // TODO do we really need to configure this?
+ IPAddress: device.Host,
+ NasID: device.NasID,
}
json, e := json.Marshal(&sadisDevice)
diff --git a/sadisTypes.go b/sadisTypes.go
index 8de85e4..96ac92c 100644
--- a/sadisTypes.go
+++ b/sadisTypes.go
@@ -65,6 +65,8 @@
ID string `json:"id"`
HardwareID string `json:"hardwareIdentifier"`
Uplink int `json:"uplinkPort"`
+ IPAddress string `json:"ipAddress"`
+ NasID string `json:"nasId"`
}
/*
@@ -74,6 +76,7 @@
Uplink string `json:"uplink"`
Host string `json:"host"`
Port int `json:"port"`
+ NasID string `json:"nas_id"`
}
type oltDevices struct {