list

package
v0.0.0-...-1ca99b1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List intents discovered by the network mapper",
	Args:  cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		return mapperclient.WithClient(func(c *mapperclient.Client) error {
			intents, err := mappershared.QueryIntents()
			if err != nil {
				return err
			}
			if viper.IsSet(mapperclient.MapperExcludeServices) {
				intents = mappershared.RemoveExcludedServices(intents, viper.GetStringSlice(mapperclient.MapperExcludeServices))
			}
			outputFormat := viper.Get(config.OutputFormatKey)
			if outputFormat != config.OutputFormatDefault {
				return fmt.Errorf("%s output format is not supported in 'list' command. Try using 'export' instead", outputFormat)
			}
			intentslister.ListFormattedIntents(intents)
			return nil
		})
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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