// listRunners lists all runners from the service
listRunners lists all runners from the service
// listRunners lists all runners from the service
func listRunners(ctx context.Context) error {
	resp, err := runnerService.List(ctx, avian.RunnerListRequest{})
	if err != nil {
		return err
	}
	var headers table.Row
	var body []table.Row
	headers = table.Row{"ID", "Runner", "Host", "Nms", "Licencetype", "Workers", "Status", "Stage"}
	for _, r := range resp.Runners {
		var status string
		var stage string
		for _, s := range r.Stages {
			stage = s.Name()
			status = s.Status()
			if status == "Running" {
				break
			}
			if status == "Failed" {
				break
			}
			if status == "Waiting" {
				break
			}
		}
		body = append(body, table.Row{r.ID, r.Name, r.Hostname, r.Nms, r.Licence, r.Workers, avian.Status(r.Status), stage})
	}
	fmt.Fprintf(os.Stdout, "%s\n", pretty.Format(headers, body))
	return nil
}
func listRunners ( ctx context . Context ) error { resp , err := runnerService . List ( ctx , avian . RunnerListRequest { } ) if err != nil { return err } var headers table . Row var body [ ] table . Row headers = table . Row { " " , " " , " " , " " , " " , " " , " " , " " } for _ , r := range resp . Runners { var status string var stage string for _ , s := range r . Stages { stage = s . Name ( ) status = s . Status ( ) if status == " " { break } if status == " " { break } if status == " " { break } } body = append ( body , table . Row { r . ID , r . Name , r . Hostname , r . Nms , r . Licence , r . Workers , avian . Status ( r . Status ) , stage } ) } fmt . Fprintf ( os . Stdout , " \n " , pretty . Format ( headers , body ) ) return nil }
listRunners lists all runners from the service
listRunners lists all runners from the service
// format the response // Break if the stage is running // Break if the stage is waiting