Commit df8f3f52 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

added sandbox controller endpoints for pdu-sessions

parent 5af993af
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE Sandbox Controller REST API
 *
 * This API is the main Sandbox Controller API for scenario deployment & event injection <p>**Micro-service**<br>[meep-sandbox-ctrl](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-sandbox-ctrl) <p>**Type & Usage**<br>Platform runtime interface to manage active scenarios and inject events in AdvantEDGE platform <p>**Details**<br>API details available at _your-AdvantEDGE-ip-address/api_
 *
 * API version: 1.0.0
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package server

import (
	"net/http"
)

func CreatePduSession(w http.ResponseWriter, r *http.Request) {
	ceCreatePduSession(w, r)
}

func TerminatePduSession(w http.ResponseWriter, r *http.Request) {
	ceTerminatePduSession(w, r)
}
+14 −0
Original line number Diff line number Diff line
@@ -115,6 +115,20 @@ var routes = Routes{
		TerminateScenario,
	},

	Route{
		"CreatePduSession",
		strings.ToUpper("Post"),
		"/sandbox-ctrl/v1/connectivity/pdu-session/{ueName}/{pduSessionId}",
		CreatePduSession,
	},

	Route{
		"TerminatePduSession",
		strings.ToUpper("Delete"),
		"/sandbox-ctrl/v1/connectivity/pdu-session/{ueName}/{pduSessionId}",
		TerminatePduSession,
	},

	Route{
		"CreateReplayFile",
		strings.ToUpper("Post"),
+10 −0
Original line number Diff line number Diff line
@@ -1082,6 +1082,16 @@ func ceStopReplayFile(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
}

func ceCreatePduSession(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
}

func ceTerminatePduSession(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
}

func activeScenarioUpdateCb(eventType string, userData interface{}) {

	// Check if update requires Virt Engine intervention