writeJSONResponse(w, smbytes, http.StatusOK)
}
}
+
// APIV1ServicemgrEventServiceIDPost function
func APIV1ServicemgrEventServiceIDPost(w http.ResponseWriter, r *http.Request) {
log.Printf("[%s] APIV1ServicemgrEventServiceIDPost", logPrefix)
vars := mux.Vars(r)
serviceID := vars["serviceid"]
- id, err := strconv.ParseUint(serviceID, 10, 64)
+ id, _ := strconv.ParseUint(serviceID, 10, 64)
- exist, _ := servicemgr.ServiceNameMap.Get(id)
+ exist, _ := servicemgr.GetServiceName(id)
- if exist == nil || err != nil {
+ if len(exist) != 0 {
smbytes, _ := json.Marshal(servicemgr.ServiceCreationResponse{Return: "NOTFOUND"})
writeJSONResponse(w, smbytes, http.StatusBadRequest)
} else {