func()

in cli/commands/entity.go [81:102]


func (cmd *Entity) show(application, entity string) {
	summary, err := entities.GetEntity(cmd.network, application, entity)
	if nil != err {
		fmt.Fprintf(os.Stderr, "Error: %s\n", err)
		os.Exit(1)
	}
	table := terminal.NewTable([]string{"Id:", summary.Id})
	table.Add("Name:", summary.Name)
	configState, err := entity_sensors.CurrentState(cmd.network, application, entity)
	if nil != err {
		error_handler.ErrorExit(err)
	}
	if serviceState, ok := configState[serviceStateSensor]; ok {
		table.Add("Status:", fmt.Sprintf("%v", serviceState))
	}
	if serviceIsUp, ok := configState[serviceIsUp]; ok {
		table.Add("ServiceUp:", fmt.Sprintf("%v", serviceIsUp))
	}
	table.Add("Type:", summary.Type)
	table.Add("CatalogItemId:", summary.CatalogItemId)
	table.Print()
}