// listServers lists all the servers
// that has been applied to the backend
listServers lists all the servers
that has been applied to the backend
// listServers lists all the servers // that has been applied to the backend
func listServers(ctx context.Context) error {
	resp, err := srvService.List(ctx, avian.ServerListRequest{})
	if err != nil {
		return err
	}
	var headers table.Row
	var body []table.Row
	headers = table.Row{"ID", "Hostname", "Port", "OS", "Nuix-Path", "Status"}
	for _, s := range resp.Servers {
		status := "Inactive"
		if s.Active {
			status = "Active"
		}
		body = append(body, table.Row{s.ID, s.Hostname, s.Port, s.OperatingSystem, s.NuixPath, status})
	}
	fmt.Println(pretty.Format(headers, body))
	return nil
}
func listServers ( ctx context . Context ) error { resp , err := srvService . List ( ctx , avian . ServerListRequest { } ) if err != nil { return err } var headers table . Row var body [ ] table . Row headers = table . Row { " " , " " , " " , " " , " " , " " } for _ , s := range resp . Servers { status := " " if s . Active { status = " " } body = append ( body , table . Row { s . ID , s . Hostname , s . Port , s . OperatingSystem , s . NuixPath , status } ) } fmt . Println ( pretty . Format ( headers , body ) ) return nil }
listServers lists all the servers
that has been applied to the backend
listServers lists all the servers that has been applied to the backend
// format the response