// EndJobInput submits inputs to an already created job.
962743
func (s *JobClient) EndInput(ctx context.Context, input *EndJobInputInput) error {
	fullPath := path.Join("/", s.client.AccountName, "jobs", input.JobID, "live", "in", "end")

	reqInput := client.RequestNoEncodeInput{
		Method: http.MethodPost,
		Path:   fullPath,
	}
	respBody, _, err := s.client.ExecuteRequestNoEncode(ctx, reqInput)
	if respBody != nil {
		defer respBody.Close()
	}
	if err != nil {
		return errors.Wrap(err, "unable to end job inputs")
	}

	return nil
}
866952
func (p *AuroraSchedulerManagerClient) CreateJob(ctx context.Context, description *JobConfiguration) (r *Response, err error) {
  var _args131 AuroraSchedulerManagerCreateJobArgs
  _args131.Description = description
  var _result132 AuroraSchedulerManagerCreateJobResult
  if err = p.Client_().Call(ctx, "createJob", &_args131, &_result132); err != nil {
    return
  }
  return _result132.GetSuccess(), nil
}
626761
func newScanJobsHandler(jobs *[]*Job) replyHandler {
	return func(reply interface{}) error {
		values, err := redis.Values(reply, nil)
		if err != nil {
			return nil
		}
		for _, fields := range values {
			job := &Job{}
			if err := scanJob(fields, job); err != nil {
				return err
			}
			(*jobs) = append((*jobs), job)
		}
		return nil
	}
}
799345
func (e *engineImpl) getJob(c context.Context, jobID string) (*Job, error) {
	job := &Job{JobID: jobID}
	switch err := ds.Get(c, job); {
	case err == nil:
		return job, nil
	case err == ds.ErrNoSuchEntity:
		return nil, nil
	default:
		return nil, transient.Tag.Apply(err)
	}
}
823417
func EndEvent(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "endEvent", Listener: listener}
}
733531
func ValueWorkerOutput(in worker.Worker, out interface{}) error {
	inWorker, _ := in.(*valueWorker)
	if inWorker == nil {
		return errors.Errorf("in should be a *valueWorker; is %#v", in)
	}
	outV := reflect.ValueOf(out)
	if outV.Kind() != reflect.Ptr {
		return errors.Errorf("out should be a pointer; is %#v", out)
	}
	outValV := outV.Elem()
	outValT := outValV.Type()
	inValV := reflect.ValueOf(inWorker.value)
	inValT := inValV.Type()
	if !inValT.ConvertibleTo(outValT) {
		return errors.Errorf("cannot output into %T", out)
	}
	outValV.Set(inValV.Convert(outValT))
	return nil
}
1039522
func (worker *Worker) RemoveJob(jobID string) error {
	qorJob, err := worker.GetJob(jobID)
	if err == nil {
		return qorJob.GetJob().GetQueue().Remove(qorJob)
	}
	return err
}
837714
func NewJob(name string, unit unit.UnitFile) *Job {
	return &Job{
		Name:            name,
		State:           nil,
		TargetState:     JobStateInactive,
		TargetMachineID: "",
		Unit:            unit,
	}
}
690393
func (c *Client) StreamJobEvents(appID string, output chan *ct.Job) (stream.Stream, error) {
	appEvents := make(chan *ct.Event)
	go convertEvents(appEvents, output)
	return c.StreamEvents(ct.StreamEventsOptions{
		AppID:       appID,
		ObjectTypes: []ct.EventType{ct.EventTypeJob},
	}, appEvents)
}
568217
func (c *Client) DeleteJob(appID, jobID string) error {
	return c.Delete(fmt.Sprintf("/apps/%s/jobs/%s", appID, jobID), nil)
}
462830
func NewBatchJob(id, name, region string, pri int) *Job {
	return newJob(id, name, region, JobTypeBatch, pri)
}
365263
func (client *Client) PollJob(jobURL JobURL) (Warnings, error) {
	var (
		err         error
		warnings    Warnings
		allWarnings Warnings
		job         Job
	)

	startTime := client.clock.Now()
	for client.clock.Now().Sub(startTime) < client.jobPollingTimeout {
		job, warnings, err = client.GetJob(jobURL)
		allWarnings = append(allWarnings, warnings...)
		if err != nil {
			return allWarnings, err
		}

		if job.HasFailed() {
			firstError := job.Errors()[0]
			return allWarnings, firstError
		}

		if job.IsComplete() {
			return allWarnings, nil
		}

		time.Sleep(client.jobPollingInterval)
	}

	return allWarnings, ccerror.JobTimeoutError{
		JobGUID: job.GUID,
		Timeout: client.jobPollingTimeout,
	}
}
451449
func (b *buffer) end() (lines int, err error) {
	if b.pos == b.size {
		return
	}

	lastLine, lastColumn := b.pos2xy(b.size)

	for ln, _ := b.pos2xy(b.pos); ln < lastLine; ln++ {
		if _, err = term.Output.Write(CursorDown); err != nil {
			return 0, outputError(err.Error())
		}
	}

	if _, err = fmt.Fprintf(term.Output, "\r\033[%dC", lastColumn); err != nil {
		return 0, outputError(err.Error())
	}
	b.pos = b.size
	return lastLine, nil
}
1358521
func (c *JobStatusCommand) outputJobInfo(client *api.Client, job *api.Job) error {

	// Query the allocations
	jobAllocs, _, err := client.Jobs().Allocations(*job.ID, c.allAllocs, nil)
	if err != nil {
		return fmt.Errorf("Error querying job allocations: %s", err)
	}

	// Query the evaluations
	jobEvals, _, err := client.Jobs().Evaluations(*job.ID, nil)
	if err != nil {
		return fmt.Errorf("Error querying job evaluations: %s", err)
	}

	latestDeployment, _, err := client.Jobs().LatestDeployment(*job.ID, nil)
	if err != nil {
		return fmt.Errorf("Error querying latest job deployment: %s", err)
	}

	// Output the summary
	if err := c.outputJobSummary(client, job); err != nil {
		return err
	}

	// Determine latest evaluation with failures whose follow up hasn't
	// completed, this is done while formatting
	var latestFailedPlacement *api.Evaluation
	blockedEval := false

	// Format the evals
	evals := make([]string, len(jobEvals)+1)
	evals[0] = "ID|Priority|Triggered By|Status|Placement Failures"
	for i, eval := range jobEvals {
		failures, _ := evalFailureStatus(eval)
		evals[i+1] = fmt.Sprintf("%s|%d|%s|%s|%s",
			limit(eval.ID, c.length),
			eval.Priority,
			eval.TriggeredBy,
			eval.Status,
			failures,
		)

		if eval.Status == "blocked" {
			blockedEval = true
		}

		if len(eval.FailedTGAllocs) == 0 {
			// Skip evals without failures
			continue
		}

		if latestFailedPlacement == nil || latestFailedPlacement.CreateIndex < eval.CreateIndex {
			latestFailedPlacement = eval
		}
	}

	if c.verbose || c.evals {
		c.Ui.Output(c.Colorize().Color("\n[bold]Evaluations[reset]"))
		c.Ui.Output(formatList(evals))
	}

	if blockedEval && latestFailedPlacement != nil {
		c.outputFailedPlacements(latestFailedPlacement)
	}

	c.outputReschedulingEvals(client, job, jobAllocs, c.length)

	if latestDeployment != nil {
		c.Ui.Output(c.Colorize().Color("\n[bold]Latest Deployment[reset]"))
		c.Ui.Output(c.Colorize().Color(c.formatDeployment(latestDeployment)))
	}

	// Format the allocs
	c.Ui.Output(c.Colorize().Color("\n[bold]Allocations[reset]"))
	c.Ui.Output(formatAllocListStubs(jobAllocs, c.verbose, c.length))
	return nil
}
996598
func (s *ShapeIndexIterator) End() {
	s.position = len(s.index.cells)
	s.refresh()
}
324536
func createStatusListOutput(jobs []*api.JobListStub) string {
	out := make([]string, len(jobs)+1)
	out[0] = "ID|Type|Priority|Status|Submit Date"
	for i, job := range jobs {
		out[i+1] = fmt.Sprintf("%s|%s|%d|%s|%s",
			job.ID,
			getTypeString(job),
			job.Priority,
			getStatusString(job.Status, &job.Stop),
			formatTime(time.Unix(0, job.SubmitTime)))
	}
	return formatList(out)
}
692400
func (jenkins *Jenkins) CreateJob(mavenJobItem MavenJobItem, jobName string) error {
	mavenJobItemXml, _ := xml.Marshal(mavenJobItem)
	reader := bytes.NewReader(mavenJobItemXml)
	params := url.Values{"name": []string{jobName}}

	return jenkins.postXml("/createItem", params, reader, nil)
}