Loading examples/demo1/src/demo-server/go/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 0.0.1 - Build date: 2020-02-20T15:30:48.431-05:00 - Build date: 2020-02-21T16:24:22.905-05:00 ### Running the server Loading examples/demo1/src/iperf-proxy/go/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 0.0.1 - Build date: 2020-02-20T15:30:50.617-05:00 - Build date: 2020-02-21T16:24:24.872-05:00 ### Running the server Loading go-apps/meep-ctrl-engine/api/swagger.yaml +23 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,13 @@ paths: required: true type: "string" x-exportParamName: "Name" - in: "body" name: "activationInfo" description: "Activation information" required: true schema: $ref: "#/definitions/ActivationInfo" x-exportParamName: "ActivationInfo" responses: 200: description: "OK" Loading Loading @@ -1024,6 +1031,14 @@ definitions: type: "string" description: "Service protocol (TCP or UDP)" description: "External service exposed internally via specific port" ActivationInfo: type: "object" properties: replayFileName: type: "string" description: "Replay-file name to execute at deployment time" description: "Activation information" example: {} NodeServiceMaps: type: "object" properties: Loading Loading @@ -1308,6 +1323,14 @@ parameters: schema: $ref: "http://localhost:8291/meep-model.yaml#/definitions/Scenario" x-exportParamName: "Scenario" ActivationInfo: in: "body" name: "activationInfo" description: "Activation information" required: true schema: $ref: "http://localhost:8291/meep-model.yaml#/definitions/ActivationInfo" x-exportParamName: "ActivationInfo" EventType: name: "type" in: "path" Loading go-apps/meep-ctrl-engine/server/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 - Build date: 2020-02-20T15:30:31.361-05:00 - Build date: 2020-02-21T16:24:05.382-05:00 ### Running the server Loading go-apps/meep-ctrl-engine/server/ctrl-engine.go +31 −2 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ const moduleMonEngine string = "mon-engine" const eventTypeMobility = "MOBILITY" const eventTypeNetCharUpdate = "NETWORK-CHARACTERISTICS-UPDATE" const eventTypePoasInRange = "POAS-IN-RANGE" const eventTypeOther = "OTHER" var scenarioStore *couch.Connector var replayStore *couch.Connector Loading Loading @@ -425,6 +426,32 @@ func ceActivateScenario(w http.ResponseWriter, r *http.Request) { return } if r.Body != nil { var actInfo ceModel.ActivationInfo decoder := json.NewDecoder(r.Body) err = decoder.Decode(&actInfo) if err != nil { log.Error(err.Error()) //we do not prevent normal proceeding if actInfo is nil } else { events, err := loadReplay(actInfo.ReplayFileName) if err != nil { log.Error(err.Error()) http.Error(w, err.Error(), http.StatusNotFound) return } err = replayMgr.Start(actInfo.ReplayFileName, events, false, false) if err != nil { log.Error(err.Error()) http.Error(w, err.Error(), http.StatusInternalServerError) return } } } // Return response w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) Loading Loading @@ -620,6 +647,8 @@ func ceSendEvent(w http.ResponseWriter, r *http.Request) { err, httpStatus, description = sendEventNetworkCharacteristics(event) case eventTypePoasInRange: err, httpStatus, description = sendEventPoasInRange(event) case eventTypeOther: //ignore the event default: err = errors.New("Unsupported event type") httpStatus = http.StatusBadRequest Loading Loading @@ -1181,7 +1210,7 @@ func ceLoopReplay(w http.ResponseWriter, r *http.Request) { return } err = replayMgr.Start(replayFileName, events, true) err = replayMgr.Start(replayFileName, events, true, true) if err == nil { w.WriteHeader(http.StatusOK) } else { Loading @@ -1202,7 +1231,7 @@ func cePlayReplayFile(w http.ResponseWriter, r *http.Request) { return } err = replayMgr.Start(replayFileName, events, false) err = replayMgr.Start(replayFileName, events, false, true) if err == nil { w.WriteHeader(http.StatusOK) Loading Loading
examples/demo1/src/demo-server/go/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 0.0.1 - Build date: 2020-02-20T15:30:48.431-05:00 - Build date: 2020-02-21T16:24:22.905-05:00 ### Running the server Loading
examples/demo1/src/iperf-proxy/go/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 0.0.1 - Build date: 2020-02-20T15:30:50.617-05:00 - Build date: 2020-02-21T16:24:24.872-05:00 ### Running the server Loading
go-apps/meep-ctrl-engine/api/swagger.yaml +23 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,13 @@ paths: required: true type: "string" x-exportParamName: "Name" - in: "body" name: "activationInfo" description: "Activation information" required: true schema: $ref: "#/definitions/ActivationInfo" x-exportParamName: "ActivationInfo" responses: 200: description: "OK" Loading Loading @@ -1024,6 +1031,14 @@ definitions: type: "string" description: "Service protocol (TCP or UDP)" description: "External service exposed internally via specific port" ActivationInfo: type: "object" properties: replayFileName: type: "string" description: "Replay-file name to execute at deployment time" description: "Activation information" example: {} NodeServiceMaps: type: "object" properties: Loading Loading @@ -1308,6 +1323,14 @@ parameters: schema: $ref: "http://localhost:8291/meep-model.yaml#/definitions/Scenario" x-exportParamName: "Scenario" ActivationInfo: in: "body" name: "activationInfo" description: "Activation information" required: true schema: $ref: "http://localhost:8291/meep-model.yaml#/definitions/ActivationInfo" x-exportParamName: "ActivationInfo" EventType: name: "type" in: "path" Loading
go-apps/meep-ctrl-engine/server/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 - Build date: 2020-02-20T15:30:31.361-05:00 - Build date: 2020-02-21T16:24:05.382-05:00 ### Running the server Loading
go-apps/meep-ctrl-engine/server/ctrl-engine.go +31 −2 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ const moduleMonEngine string = "mon-engine" const eventTypeMobility = "MOBILITY" const eventTypeNetCharUpdate = "NETWORK-CHARACTERISTICS-UPDATE" const eventTypePoasInRange = "POAS-IN-RANGE" const eventTypeOther = "OTHER" var scenarioStore *couch.Connector var replayStore *couch.Connector Loading Loading @@ -425,6 +426,32 @@ func ceActivateScenario(w http.ResponseWriter, r *http.Request) { return } if r.Body != nil { var actInfo ceModel.ActivationInfo decoder := json.NewDecoder(r.Body) err = decoder.Decode(&actInfo) if err != nil { log.Error(err.Error()) //we do not prevent normal proceeding if actInfo is nil } else { events, err := loadReplay(actInfo.ReplayFileName) if err != nil { log.Error(err.Error()) http.Error(w, err.Error(), http.StatusNotFound) return } err = replayMgr.Start(actInfo.ReplayFileName, events, false, false) if err != nil { log.Error(err.Error()) http.Error(w, err.Error(), http.StatusInternalServerError) return } } } // Return response w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) Loading Loading @@ -620,6 +647,8 @@ func ceSendEvent(w http.ResponseWriter, r *http.Request) { err, httpStatus, description = sendEventNetworkCharacteristics(event) case eventTypePoasInRange: err, httpStatus, description = sendEventPoasInRange(event) case eventTypeOther: //ignore the event default: err = errors.New("Unsupported event type") httpStatus = http.StatusBadRequest Loading Loading @@ -1181,7 +1210,7 @@ func ceLoopReplay(w http.ResponseWriter, r *http.Request) { return } err = replayMgr.Start(replayFileName, events, true) err = replayMgr.Start(replayFileName, events, true, true) if err == nil { w.WriteHeader(http.StatusOK) } else { Loading @@ -1202,7 +1231,7 @@ func cePlayReplayFile(w http.ResponseWriter, r *http.Request) { return } err = replayMgr.Start(replayFileName, events, false) err = replayMgr.Start(replayFileName, events, false, true) if err == nil { w.WriteHeader(http.StatusOK) Loading