func alloc_job(w http.ResponseWriter, r *http.Request) { var slreq C.job_desc_msg_t C.slurm_init_job_desc_msg(&slreq) obj := make(object_map) obj.Add(&slreq) obj.Run(w, r, func() { var slres *C.resource_allocation_response_msg_t ret := C.slurm_allocate_resources(&slreq, &slres) if ret != 0 { slurm_error(w, r) return } res := get_res(slres) C.slurm_free_resource_allocation_response_msg(slres) w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(&res) }) }
func update_job(w http.ResponseWriter, r *http.Request) { var slreq C.job_desc_msg_t C.slurm_init_job_desc_msg(&slreq) obj := make(object_map) obj.Add(&slreq) obj.Run(w, r, func() { ret := C.slurm_update_job(&slreq) if ret != 0 { slurm_error(w, r) return } }) }