[SEBA-202] Adding remote_id
Change-Id: I9346ded6376e66aa571f835f970d6bba7a91353d
diff --git a/Dockerfile b/Dockerfile
index 9e08850..9f97dbf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# docker build -t sadis-server:candidate .
+
FROM golang:1.7-alpine as builder
MAINTAINER Open Networking Foundation <info@opennetworking.org>
diff --git a/handlers.go b/handlers.go
index 791073e..ef2e5af 100644
--- a/handlers.go
+++ b/handlers.go
@@ -14,13 +14,13 @@
package main
import (
- "strconv"
"encoding/json"
"net/http"
+ "strconv"
+
"github.com/gorilla/mux"
)
-
func (c *Config) getSubscriberHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
sadisRequestID := vars["id"]
@@ -45,12 +45,12 @@
if sub.OnuSerialNumber == sadisRequestID {
log.Infof("Found subscriber with ID %s", sub.OnuSerialNumber)
sadisSubscriber := sadisSubscriber{
- ID: sub.OnuSerialNumber,
- CTag: sub.CTag,
- STag: sub.STag,
+ ID: sub.OnuSerialNumber,
+ CTag: sub.CTag,
+ STag: sub.STag,
NasPortID: sub.NasPortID,
CircuitID: sub.CircuitID,
- RemoteID: sub.CircuitID, // TODO get a proper value here
+ RemoteID: sub.RemoteID,
}
json, e := json.Marshal(&sadisSubscriber)
@@ -81,8 +81,8 @@
if devID == sadisRequestID {
log.Infof("Found OLT device with ID %s", devID)
sadisDevice := sadisDevice{
- ID: devID,
- Uplink: toInt(device.Uplink),
+ ID: devID,
+ Uplink: toInt(device.Uplink),
HardwareID: "de:ad:be:ef:ba:11", // TODO do we really need to configure this?
}
diff --git a/sadisTypes.go b/sadisTypes.go
index 0e807b6..8de85e4 100644
--- a/sadisTypes.go
+++ b/sadisTypes.go
@@ -27,23 +27,24 @@
ONOS SADIS subscriber format
*/
type sadisSubscriber struct {
- ID string `json:"id"`
- CTag int16 `json:"cTag"`
- STag int16 `json:"sTag"`
+ ID string `json:"id"`
+ CTag int16 `json:"cTag"`
+ STag int16 `json:"sTag"`
NasPortID string `json:"nasPortId"`
CircuitID string `json:"circuitId"`
- RemoteID string `json:"remoteId"`
+ RemoteID string `json:"remoteId"`
}
/*
XOS RCORD subscriber format
*/
type subscriber struct {
- CTag int16 `json:"c_tag"`
- STag int16 `json:"s_tag"`
+ CTag int16 `json:"c_tag"`
+ STag int16 `json:"s_tag"`
OnuSerialNumber string `json:"onu_device"`
- NasPortID string `json:"nas_port_id"`
- CircuitID string `json:"circuit_id"`
+ NasPortID string `json:"nas_port_id"`
+ CircuitID string `json:"circuit_id"`
+ RemoteID string `json:"remote_id"`
}
type subscribers struct {
@@ -61,9 +62,9 @@
ONOS SADIS device format
*/
type sadisDevice struct {
- ID string `json:"id"`
+ ID string `json:"id"`
HardwareID string `json:"hardwareIdentifier"`
- Uplink int `json:"uplinkPort"`
+ Uplink int `json:"uplinkPort"`
}
/*
@@ -71,8 +72,8 @@
*/
type oltDevice struct {
Uplink string `json:"uplink"`
- Host string `json:"host"`
- Port int `json:"port"`
+ Host string `json:"host"`
+ Port int `json:"port"`
}
type oltDevices struct {