report

package
v1.5.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "report",
	Short: "Generate inventory reports based on CAI outputs in a directory.",
	Long: `Generate inventory reports for resources in Cloud Asset Inventory (CAI) output files, with reports defined in rego (in '<path_to_cloud-foundation-toolkit>/reports/sample' folder).

	Example:
	  cft report --query-path <path_to_cloud-foundation-toolkit>/reports/sample \
		--dir-path <path-to-directory-containing-cai-export> \
		--report-path <path-to-directory-for-report-output>
	`,

	Args: cobra.NoArgs,

	RunE: func(cmd *cobra.Command, args []string) error {
		err := GenerateReports(flags.dirName, flags.queryPath, flags.outputPath, viper.GetString("report-format"))
		if err != nil {
			return err
		}
		return nil
	},
}

Cmd represents the base report command

Functions

func GenerateReports

func GenerateReports(dirPath string, queryPath string, outputPath string, reportFormat string) error

GenerateReports takes raw CAI exports from <dirPath> directory, run rego queries defined <queryPath> directory, and generate output of <reportFormat> in <outputPath> directory

func ListAvailableReports

func ListAvailableReports(queryPath string) error

ListAvailableReports lists the names of available reports in queryPath

func ReadFilesAndConcat

func ReadFilesAndConcat(dir string) (results []interface{}, err error)

ReadFilesAndConcat reads json files in a directory that are one object per row, and concats all objects into one single array

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL