func stateJobsToAPIParamsJobs(jobs []state.MachineJob) []params.MachineJob { pjobs := make([]params.MachineJob, len(jobs)) for i, job := range jobs { pjobs[i] = params.MachineJob(job.String()) } return pjobs }
// ToParams returns the job as params.MachineJob. func (job MachineJob) ToParams() params.MachineJob { if paramsJob, ok := jobNames[job]; ok { return paramsJob } return params.MachineJob(fmt.Sprintf("<unknown job %d>", int(job))) }