Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetAccessGraph = &cobra.Command{ Use: "get", Short: "Get access graph", SilenceUsage: true, Args: cobra.NoArgs, 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 := cloudapi.InputAccessGraphFilter{ IncludeServicesWithNoEdges: lo.ToPtr(true), ClusterIds: lo.Ternary(viper.IsSet(clustersIdsKey), lo.ToPtr(viper.GetStringSlice(clustersIdsKey)), nil), EnvironmentIds: lo.Ternary(viper.IsSet(envIdsKey), lo.ToPtr(viper.GetStringSlice(envIdsKey)), nil), NamespaceIds: lo.Ternary(viper.IsSet(namespacesIdsKey), lo.ToPtr(viper.GetStringSlice(namespacesIdsKey)), nil), ServiceIds: lo.Ternary(viper.IsSet(servicesIdsKey), lo.ToPtr(viper.GetStringSlice(servicesIdsKey)), nil), } if viper.IsSet(lastSeenAfterKey) { lastSeenAfterStr := viper.GetString(lastSeenAfterKey) lastSeenAfter, err := time.Parse(time.RFC3339, lastSeenAfterStr) if err != nil { return fmt.Errorf("invalid last seen after format: %s", err) } filter.LastSeenAfter = &lastSeenAfter } r, err := c.AccessGraphQueryWithResponse(ctxTimeout, cloudapi.AccessGraphQueryJSONRequestBody{Filter: &filter}) if err != nil { return err } output.FormatAccessGraph(lo.FromPtr(r.JSON200)) return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.