Search in sources :

Example 11 with ProgramRecord

use of co.cask.cdap.proto.ProgramRecord in project cdap by caskdata.

the class DescribeAppCommand method perform.

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
    ApplicationId appId = parseApplicationId(arguments);
    List<ProgramRecord> programsList = applicationClient.listPrograms(appId);
    Table table = Table.builder().setHeader("type", "id", "description").setRows(programsList, new RowMaker<ProgramRecord>() {

        @Override
        public List<?> makeRow(ProgramRecord object) {
            return Lists.newArrayList(object.getType().getPrettyName(), object.getName(), object.getDescription());
        }
    }).build();
    cliConfig.getTableRenderer().render(cliConfig, output, table);
}
Also used : Table(co.cask.cdap.cli.util.table.Table) ProgramRecord(co.cask.cdap.proto.ProgramRecord) RowMaker(co.cask.cdap.cli.util.RowMaker) ApplicationId(co.cask.cdap.proto.id.ApplicationId)

Aggregations

ProgramRecord (co.cask.cdap.proto.ProgramRecord)11 ApplicationId (co.cask.cdap.proto.id.ApplicationId)4 RowMaker (co.cask.cdap.cli.util.RowMaker)3 Table (co.cask.cdap.cli.util.table.Table)3 NotFoundException (co.cask.cdap.common.NotFoundException)3 ProgramType (co.cask.cdap.proto.ProgramType)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 BadRequestException (co.cask.cdap.common.BadRequestException)2 ConflictException (co.cask.cdap.common.ConflictException)2 ProgramNotFoundException (co.cask.cdap.common.ProgramNotFoundException)2 BatchProgramStatus (co.cask.cdap.proto.BatchProgramStatus)2 NamespaceId (co.cask.cdap.proto.id.NamespaceId)2 ProgramId (co.cask.cdap.proto.id.ProgramId)2 UnauthorizedException (co.cask.cdap.security.spi.authorization.UnauthorizedException)2 ApplicationSpecification (co.cask.cdap.api.app.ApplicationSpecification)1 FakeApp (co.cask.cdap.client.app.FakeApp)1 ApplicationNotFoundException (co.cask.cdap.common.ApplicationNotFoundException)1 MethodNotAllowedException (co.cask.cdap.common.MethodNotAllowedException)1