func()

in internal/renderers/report_data.go [318:356]


func (rd *ReportData) resourcesTable(resources []*models.Resource) [][]string {
	headers := []string{"Subscription Id", "Resource Group", "Location", "Resource Type", "Resource Name", "Sku Name", "Sku Tier", "Kind", "SLA", "Resource Id"}

	rows := [][]string{}
	for _, r := range resources {
		sla := ""

		for _, a := range rd.Azqr {
			if strings.EqualFold(strings.ToLower(a.ResourceID()), strings.ToLower(r.ID)) {
				for _, rc := range a.Recommendations {
					if rc.RecommendationType == models.TypeSLA {
						sla = rc.Result
						break
					}
				}
				if sla != "" {
					break
				}
			}
		}

		row := []string{
			MaskSubscriptionID(r.SubscriptionID, rd.Mask),
			r.ResourceGroup,
			r.Location,
			r.Type,
			r.Name,
			r.SkuName,
			r.SkuTier,
			r.Kind,
			sla,
			MaskSubscriptionIDInResourceID(r.ID, rd.Mask),
		}
		rows = append(rows, row)
	}

	rows = append([][]string{headers}, rows...)
	return rows
}