Пример #1
0
// PrintTable Prints an ascii table of the list of EBS Snapshots
func (s *Snapshots) PrintTable() {
	if len(*s) == 0 {
		terminal.ShowErrorMessage("Warning", "No Snapshots Found!")
		return
	}

	var header []string
	rows := make([][]string, len(*s))

	for index, snapshot := range *s {
		models.ExtractAwsmTable(index, snapshot, &header, &rows)
	}

	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader(header)
	table.AppendBulk(rows)
	table.Render()
}
Пример #2
0
// PrintTable Prints an ascii table of the list of EBS Volumes
func (v *Volumes) PrintTable() {
	if len(*v) == 0 {
		terminal.ShowErrorMessage("Warning", "No Volumes Found!")
		return
	}

	var header []string
	rows := make([][]string, len(*v))

	for index, vol := range *v {
		models.ExtractAwsmTable(index, vol, &header, &rows)
	}

	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader(header)
	table.AppendBulk(rows)
	table.Render()
}
Пример #3
0
// PrintTable Prints an ascii table of the list of AutoScaling Groups
func (a *AutoScaleGroups) PrintTable() {
	if len(*a) == 0 {
		terminal.ShowErrorMessage("Warning", "No Autoscale Groups Found!")
		return
	}

	var header []string
	rows := make([][]string, len(*a))

	for index, asg := range *a {
		models.ExtractAwsmTable(index, asg, &header, &rows)
	}

	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader(header)
	table.AppendBulk(rows)
	table.Render()
}
Пример #4
0
// PrintTable Prints an ascii table of the list of SimpleDB Domains
func (i *SimpleDBDomains) PrintTable() {
	if len(*i) == 0 {
		terminal.ShowErrorMessage("Warning", "No SimpleDB Domains Found!")
		return
	}

	var header []string
	rows := make([][]string, len(*i))

	for index, domain := range *i {
		models.ExtractAwsmTable(index, domain, &header, &rows)
	}

	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader(header)
	table.AppendBulk(rows)
	table.Render()
}
Пример #5
0
// PrintTable Prints an ascii table of the list of Launch Configurations
func (l *LaunchConfigs) PrintTable() {
	if len(*l) == 0 {
		terminal.ShowErrorMessage("Warning", "No Launch Configurations Found!")
		return
	}

	var header []string
	rows := make([][]string, len(*l))

	for index, lc := range *l {
		models.ExtractAwsmTable(index, lc, &header, &rows)
	}

	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader(header)
	table.AppendBulk(rows)
	table.Render()
}
Пример #6
0
// PrintTable Prints an ascii table of the list of Application Load Balancers
func (i *LoadBalancersV2) PrintTable() {
	if len(*i) == 0 {
		terminal.ShowErrorMessage("Warning", "No Application Load Balancers Found!")
		return
	}

	var header []string
	rows := make([][]string, len(*i))

	for index, lb := range *i {
		models.ExtractAwsmTable(index, lb, &header, &rows)
	}

	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader(header)
	table.AppendBulk(rows)
	table.Render()
}