org.springframework.shell.table.BeanListTableModel Java Examples
The following examples show how to use
org.springframework.shell.table.BeanListTableModel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReleaseCommands.java From spring-cloud-skipper with Apache License 2.0 | 6 votes |
@ShellMethod(key = "release list", value = "List the latest version of releases with status of deployed or failed.") public Table list( @ShellOption(help = "wildcard expression to search by release name", defaultValue = ShellOption.NULL) String releaseName) { List<Release> releases = this.skipperClient.list(releaseName); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Name"); headers.put("version", "Version"); headers.put("info.lastDeployed", "Last updated"); headers.put("info.status.statusCode", "Status"); headers.put("pkg.metadata.name", "Package Name"); headers.put("pkg.metadata.version", "Package Version"); headers.put("platformName", "Platform Name"); headers.put("info.status.platformStatusPrettyPrint", "Platform Status"); TableModel model = new BeanListTableModel<>(releases, headers); TableBuilder tableBuilder = new TableBuilder(model); TableUtils.applyStyle(tableBuilder); return tableBuilder.build(); }
Example #2
Source File: ReleaseCommands.java From spring-cloud-skipper with Apache License 2.0 | 6 votes |
@ShellMethod(key = "release history", value = "List the history of versions for a given release.") public Table history( @ShellOption(help = "wildcard expression to search by release name") @NotNull String releaseName) { Collection<Release> releases; releases = this.skipperClient.history(releaseName); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("version", "Version"); headers.put("info.lastDeployed", "Last updated"); headers.put("info.status.statusCode", "Status"); headers.put("pkg.metadata.name", "Package Name"); headers.put("pkg.metadata.version", "Package Version"); headers.put("info.description", "Description"); TableModel model = new BeanListTableModel<>(releases, headers); TableBuilder tableBuilder = new TableBuilder(model); TableUtils.applyStyle(tableBuilder); return tableBuilder.build(); }
Example #3
Source File: TaskCommands.java From spring-cloud-dataflow with Apache License 2.0 | 6 votes |
@CliCommand(value = EXECUTION_LIST, help = "List created task executions filtered by taskName") public Table executionListByName( @CliOption(key = "name", help = "the task name to be used as a filter", optionContext = "existing-task disable-string-converter") String name) { final PagedModel<TaskExecutionResource> tasks; if (name == null) { tasks = taskOperations().executionList(); } else { tasks = taskOperations().executionListByTaskName(name); } LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("taskName", "Task Name"); headers.put("executionId", "ID"); headers.put("startTime", "Start Time"); headers.put("endTime", "End Time"); headers.put("exitCode", "Exit Code"); final TableBuilder builder = new TableBuilder(new BeanListTableModel<>(tasks, headers)); return DataFlowTables.applyStyle(builder).build(); }
Example #4
Source File: StreamCommands.java From spring-cloud-dataflow with Apache License 2.0 | 6 votes |
@CliCommand(value = STREAM_HISTORY, help = "Get history for the stream deployed using Skipper") public Table history( @CliOption(key = { "", "name" }, help = "the name of the stream", mandatory = true, optionContext = "existing-stream " + "disable-string-converter") String name) { Collection<Release> releases = streamOperations().history(name); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("version", "Version"); headers.put("info.lastDeployed", "Last updated"); headers.put("info.status.statusCode", "Status"); headers.put("pkg.metadata.name", "Package Name"); headers.put("pkg.metadata.version", "Package Version"); headers.put("info.description", "Description"); TableModel model = new BeanListTableModel<>(releases, headers); TableBuilder tableBuilder = new TableBuilder(model); DataFlowTables.applyStyle(tableBuilder); return tableBuilder.build(); }
Example #5
Source File: TaskSchedulerCommands.java From spring-cloud-dataflow with Apache License 2.0 | 6 votes |
@CliCommand(value = SCHEDULER_LIST, help = "List task schedules by task definition name") public Table listByDefinition( @CliOption(key = { "platform" }, help = "the name platform from which to retrieve a list of schedules") String platform, @CliOption(key = { "definitionName" }, help = "the task definition name") String definitionName) { PagedModel<ScheduleInfoResource> schedules; if (Strings.isEmpty(definitionName)) { schedules = scheduleOperations().listByPlatform(platform); } else { schedules = scheduleOperations().list(definitionName, platform); } LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("scheduleName", "Schedule Name"); headers.put("taskDefinitionName", "Task Definition Name"); headers.put("scheduleProperties", "Properties"); final TableBuilder builder = new TableBuilder(new BeanListTableModel<>(schedules, headers)); return DataFlowTables.applyStyle(builder).build(); }
Example #6
Source File: RepositoryCommands.java From spring-cloud-skipper with Apache License 2.0 | 5 votes |
@ShellMethod(key = "repo list", value = "List package repositories") public Table list() { Collection<Repository> repositoryResources = this.skipperClient.listRepositories(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Name"); headers.put("url", "URL"); headers.put("local", "Local"); headers.put("repoOrder", "Order"); TableModel model = new BeanListTableModel<>(repositoryResources, headers); TableBuilder tableBuilder = new TableBuilder(model); return TableUtils.applyStyle(tableBuilder).build(); }
Example #7
Source File: PlatformCommands.java From spring-cloud-skipper with Apache License 2.0 | 5 votes |
@ShellMethod(key = "platform list", value = "List platforms") public Table list() { Collection<Deployer> repositoryResources = this.skipperClient.listDeployers(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Name"); headers.put("type", "Type"); headers.put("description", "Description"); TableModel model = new BeanListTableModel<>(repositoryResources, headers); TableBuilder tableBuilder = new TableBuilder(model); return TableUtils.applyStyle(tableBuilder).build(); }
Example #8
Source File: ApplicationCommands.java From spring-cloud-dashboard with Apache License 2.0 | 5 votes |
@CliCommand(value = LIST_APPLICATION, help = "List created applications") public Table listApplications() { final PagedResources<ApplicationDefinitionResource> applications = applicationOperations().list(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Application Name"); headers.put("dslText", "Application Definition"); headers.put("status", "Status"); BeanListTableModel<ApplicationDefinitionResource> model = new BeanListTableModel<>(applications, headers); return DataFlowTables.applyStyle(new TableBuilder(model)) .build(); }
Example #9
Source File: TaskCommands.java From spring-cloud-dataflow with Apache License 2.0 | 5 votes |
@CliCommand(value = LIST, help = "List created tasks") public Table list() { final PagedModel<TaskDefinitionResource> tasks = taskOperations().list(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Task Name"); headers.put("dslText", "Task Definition"); headers.put("description", "description"); headers.put("status", "Task Status"); final TableBuilder builder = new TableBuilder(new BeanListTableModel<>(tasks, headers)); return DataFlowTables.applyStyle(builder).build(); }
Example #10
Source File: TaskCommands.java From spring-cloud-dataflow with Apache License 2.0 | 5 votes |
@CliCommand(value = PLATFORM_LIST, help = "List platform accounts for tasks") public Table listPlatforms() { final PagedModel<LauncherResource> platforms = taskOperations().listPlatforms(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Platform Name"); headers.put("type", "Platform Type"); headers.put("description", "Description"); final TableBuilder builder = new TableBuilder(new BeanListTableModel<>(platforms, headers)); return DataFlowTables.applyStyle(builder).build(); }
Example #11
Source File: TaskCommands.java From spring-cloud-dataflow with Apache License 2.0 | 5 votes |
@CliCommand(value = TASK_EXECUTION_CURRENT, help = "Display count of currently executin tasks and related information") public Table currentExecutions() { Collection<CurrentTaskExecutionsResource> taskExecutionsResources = taskOperations().currentTaskExecutions(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Platform Name"); headers.put("type", "Platform Type"); headers.put("runningExecutionCount", "Execution Count"); headers.put("maximumTaskExecutions", "Maximum Executions"); TableBuilder builder = new TableBuilder(new BeanListTableModel<>(taskExecutionsResources, headers)); DataFlowTables.applyStyle(builder); return builder.build(); }
Example #12
Source File: StreamCommands.java From spring-cloud-dataflow with Apache License 2.0 | 5 votes |
@CliCommand(value = STREAM_PLATFORM_LIST, help = "List Skipper platforms") public Table listPlatforms() { Collection<Deployer> platforms = streamOperations().listPlatforms(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Name"); headers.put("type", "Type"); headers.put("description", "Description"); BeanListTableModel<Deployer> model = new BeanListTableModel<>(platforms, headers); return DataFlowTables.applyStyle(new TableBuilder(model)).build(); }
Example #13
Source File: StreamCommands.java From spring-cloud-dataflow with Apache License 2.0 | 5 votes |
@CliCommand(value = LIST_STREAM, help = "List created streams") public Table listStreams() { final PagedModel<StreamDefinitionResource> streams = streamOperations().list(); LinkedHashMap<String, Object> headers = new LinkedHashMap<>(); headers.put("name", "Stream Name"); headers.put("description", "Description"); headers.put("originalDslText", "Stream Definition"); headers.put("statusDescription", "Status"); BeanListTableModel<StreamDefinitionResource> model = new BeanListTableModel<>(streams, headers); return DataFlowTables.applyStyle(new TableBuilder(model)).build(); }