Loading go-apps/meep-app-enablement/server/service-mgmt/model_service_liveness_update.go +2 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,6 @@ */ package server type ServiceLivenessUpdate struct { // FSCOM Chang manuall (remove *) State ServiceState `json:"state"` type ServiceLivenessUpdate struct { State *ServiceState `json:"state"` } go-apps/meep-app-enablement/server/service-mgmt/service-mgmt.go +21 −2 Original line number Diff line number Diff line Loading @@ -240,6 +240,11 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) { } // Retrieve request parameters from body if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } // NOTE: Set default values for omitted fields locality := MEC_HOST_LocalityType sInfoPost := ServiceInfo{ Loading Loading @@ -400,6 +405,11 @@ func appServicesByIdPUT(w http.ResponseWriter, r *http.Request) { sInfoPrev := convertJsonToServiceInfo(sInfoPrevJson) // Retrieve request parameters from body if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } // NOTE: Set default values for omitted fields locality := MEC_HOST_LocalityType sInfo := ServiceInfo{ Loading Loading @@ -639,6 +649,11 @@ func applicationsSubscriptionsPOST(w http.ResponseWriter, r *http.Request) { } // Retrieve subscription request if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } var serAvailNotifSub SerAvailabilityNotificationSubscription decoder := json.NewDecoder(r.Body) err = decoder.Decode(&serAvailNotifSub) Loading Loading @@ -947,6 +962,11 @@ func patchIndividualMECService(w http.ResponseWriter, r *http.Request) { return } else { // Retrieve request if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } var serviceLivenessUpdate ServiceLivenessUpdate decoder := json.NewDecoder(r.Body) err := decoder.Decode(&serviceLivenessUpdate) Loading @@ -956,8 +976,7 @@ func patchIndividualMECService(w http.ResponseWriter, r *http.Request) { return } log.Info("patchIndividualMECService: serviceLivenessUpdate: ", serviceLivenessUpdate) log.Info("patchIndividualMECService: serviceLivenessUpdate: ", serviceLivenessUpdate.State) if serviceLivenessUpdate.State == ACTIVE_ServiceState { if *serviceLivenessUpdate.State == ACTIVE_ServiceState { entry.State = &ACTIVE_ServiceState } else { // ETSI GS MEC 011 V3.2.1 (2024-04) Table 8.1.2.5-1: Attributes of ServiceLivenessUpdate err := errors.New("Wrong body content") Loading Loading
go-apps/meep-app-enablement/server/service-mgmt/model_service_liveness_update.go +2 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,6 @@ */ package server type ServiceLivenessUpdate struct { // FSCOM Chang manuall (remove *) State ServiceState `json:"state"` type ServiceLivenessUpdate struct { State *ServiceState `json:"state"` }
go-apps/meep-app-enablement/server/service-mgmt/service-mgmt.go +21 −2 Original line number Diff line number Diff line Loading @@ -240,6 +240,11 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) { } // Retrieve request parameters from body if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } // NOTE: Set default values for omitted fields locality := MEC_HOST_LocalityType sInfoPost := ServiceInfo{ Loading Loading @@ -400,6 +405,11 @@ func appServicesByIdPUT(w http.ResponseWriter, r *http.Request) { sInfoPrev := convertJsonToServiceInfo(sInfoPrevJson) // Retrieve request parameters from body if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } // NOTE: Set default values for omitted fields locality := MEC_HOST_LocalityType sInfo := ServiceInfo{ Loading Loading @@ -639,6 +649,11 @@ func applicationsSubscriptionsPOST(w http.ResponseWriter, r *http.Request) { } // Retrieve subscription request if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } var serAvailNotifSub SerAvailabilityNotificationSubscription decoder := json.NewDecoder(r.Body) err = decoder.Decode(&serAvailNotifSub) Loading Loading @@ -947,6 +962,11 @@ func patchIndividualMECService(w http.ResponseWriter, r *http.Request) { return } else { // Retrieve request if r.Body == nil { err := errors.New("Request body is missing") errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) return } var serviceLivenessUpdate ServiceLivenessUpdate decoder := json.NewDecoder(r.Body) err := decoder.Decode(&serviceLivenessUpdate) Loading @@ -956,8 +976,7 @@ func patchIndividualMECService(w http.ResponseWriter, r *http.Request) { return } log.Info("patchIndividualMECService: serviceLivenessUpdate: ", serviceLivenessUpdate) log.Info("patchIndividualMECService: serviceLivenessUpdate: ", serviceLivenessUpdate.State) if serviceLivenessUpdate.State == ACTIVE_ServiceState { if *serviceLivenessUpdate.State == ACTIVE_ServiceState { entry.State = &ACTIVE_ServiceState } else { // ETSI GS MEC 011 V3.2.1 (2024-04) Table 8.1.2.5-1: Attributes of ServiceLivenessUpdate err := errors.New("Wrong body content") Loading