Documentation
¶
Index ¶
Constants ¶
View Source
const ( OutputLocationKey = "output" OutputLocationShorthand = "o" OutputTypeKey = "output-type" ClustersKey = "clusters" ClustersShortHand = "c" NamespacesKey = "namespaces" NamespacesShorthand = "n" ServicesKey = "services" ServicesShorthand = "s" )
View Source
const ( OutputTypeSingleFile = "single-file" OutputTypeDirectory = "dir" )
Variables ¶
View Source
var ExportClientIntentsCmd = &cobra.Command{ Use: "export [<service-id>]", Short: "Export client intents for a service", Args: cobra.MaximumNArgs(1), SilenceUsage: true, RunE: func(_ *cobra.Command, args []string) error { ctxTimeout, cancel := context.WithTimeout(context.Background(), config.DefaultTimeout) defer cancel() c, err := cloudclient.NewClient(ctxTimeout) if err != nil { return err } filter := servicesFilterFromFlags() if len(args) == 1 { serviceID := args[0] filter.ServiceIds = lo.ToPtr(append(lo.FromPtr(filter.ServiceIds), serviceID)) } r, err := c.ClientIntentsQueryWithResponse(ctxTimeout, cloudapi.ClientIntentsQueryJSONRequestBody{ ClusterIds: filter.ClusterIds, Filter: filter, LastSeenAfter: nil, FeatureFlags: nil, }) if err != nil { return err } outputLocation := viper.GetString(OutputLocationKey) outputType := viper.GetString(OutputTypeKey) return writeExportedIntents(lo.FromPtr(r.JSON200), outputLocation, outputType) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.