func update_reservation(w http.ResponseWriter, r *http.Request) { var slreq C.resv_desc_msg_t C.slurm_init_resv_desc_msg(&slreq) obj := make(object_map) obj.Add(&slreq) obj.Run(w, r, func() { ret := C.slurm_update_reservation(&slreq) if ret != 0 { slurm_error(w, r) return } }) }
func create_reservation(w http.ResponseWriter, r *http.Request) { var slreq C.resv_desc_msg_t C.slurm_init_resv_desc_msg(&slreq) obj := make(object_map) obj.Add(&slreq) obj.Run(w, r, func() { ret := C.slurm_create_reservation(&slreq) if ret == nil { slurm_error(w, r) return } res := get_res(&slreq) w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(&res) }) }