Documentation
¶
Index ¶
- Variables
- func AddFlag(cmd *CmdOptions, p *models.Parameter, factory *cmdutil.Factory) error
- func AddPredefinedGroupsFlags(cmd *CmdOptions, factory *cmdutil.Factory, template models.CommandPreset)
- func AppendCompletionOptions(opts []completion.Option, cmd *CmdOptions, p *models.Parameter, ...) []completion.Option
- func ApplyCommandFilter(options config.CommonCommandOptions, spec models.Command) error
- func ApplyCommandView(factory *cmdutil.Factory, cfg *config.Config, spec models.Command) error
- func GetCompletionOptions(cmd *CmdOptions, p *models.Parameter, factory *cmdutil.Factory) completion.Option
- func GetOption(cmd *CmdOptions, p *models.Parameter, factory *cmdutil.Factory, args []string) []flags.GetOption
- func MapCommandAPI(cmd *CmdOptions, param *models.Parameter, typeName string)
- func NewCommandFromSpec(item models.Command, factory *cmdutil.Factory, origin string) (*cobra.Command, error)
- func ParseCommand(r io.Reader, factory *cmdutil.Factory, rootCmd *cobra.Command) (*cobra.Command, error)
- func ParseSpec(r io.Reader) (*models.Specification, error)
- func ResolveCommandView(dataView *dataview.DataView, spec models.Command) (*dataview.Definition, error)
- func StringArg(cmd *CmdOptions, param *models.Parameter)
- type BodyOptions
- type CmdOptions
- type Command
- type PathOptions
- type RuntimeCmd
Constants ¶
This section is empty.
Variables ¶
var ( PresetQueryInventory = "query-inventory" PresetGetIdentity = "get-identity" PresetQueryInventoryChildren = "query-inventory-children" )
var ( CommonFlagsQuery = "query" CommonFlagsTemplate = "queryTemplate" CommonFlagsOrderBy = "orderBy" CommonFlagsName = "name" CommonFlagsType = "type" CommonFlagsAgents = "agents" CommonFlagsFragmentType = "fragmentType" CommonFlagsOwner = "owner" CommonFlagsAvailability = "availability" CommonFlagsLastMessageDateTo = "lastMessageDateTo" CommonFlagsLastMessageDateFrom = "lastMessageDateFrom" CommonFlagsCreationTimeDateTo = "creationTimeDateTo" CommonFlagsCreationTimeDateFrom = "creationTimeDateFrom" CommonFlagsGroup = "group" CommonFlagsSkipChildrenNames = "skipChildrenNames" CommonFlagsWithChildren = "withChildren" CommonFlagsWithChildrenCount = "withChildrenCount" CommonFlagsWithGroups = "withGroups" CommonFlagsWithParents = "withParents" )
Functions ¶
func AddPredefinedGroupsFlags ¶
func AddPredefinedGroupsFlags(cmd *CmdOptions, factory *cmdutil.Factory, template models.CommandPreset)
func AppendCompletionOptions ¶
func AppendCompletionOptions(opts []completion.Option, cmd *CmdOptions, p *models.Parameter, factory *cmdutil.Factory) []completion.Option
func ApplyCommandFilter ¶ added in v2.57.0
func ApplyCommandFilter(options config.CommonCommandOptions, spec models.Command) error
ApplyCommandFilter adds the client side filters of an extension API command to the output filters. The filters are combined with the filters provided by the user (via --filter), so the user can only narrow the results further.
The common options are cached by the configuration and the filters are referenced by pointer, so the filters are used when the response is processed
func ApplyCommandView ¶ added in v2.57.0
ApplyCommandView activates the default view of an extension API command. The view is only applied when automatic view detection is active, so it does not override views selected by the user (e.g. --view <name> or --view off). The --select flag is not affected, as it already takes precedence over views
func GetCompletionOptions ¶
func GetCompletionOptions(cmd *CmdOptions, p *models.Parameter, factory *cmdutil.Factory) completion.Option
func MapCommandAPI ¶
func MapCommandAPI(cmd *CmdOptions, param *models.Parameter, typeName string)
func NewCommandFromSpec ¶ added in v2.57.0
func NewCommandFromSpec(item models.Command, factory *cmdutil.Factory, origin string) (*cobra.Command, error)
NewCommandFromSpec creates the runtime command for a single command in an extension API specification. The origin (e.g. the file path of the specification) is only used in log messages.
func ParseCommand ¶
func ParseCommand(r io.Reader, factory *cmdutil.Factory, rootCmd *cobra.Command) (*cobra.Command, error)
ParseCommand parses an extension API specification and returns a cobra command group containing all of the commands defined in the specification. It returns nil if the specification's group should be skipped.
func ParseSpec ¶ added in v2.57.0
func ParseSpec(r io.Reader) (*models.Specification, error)
ParseSpec reads an extension API specification
func ResolveCommandView ¶ added in v2.57.0
func ResolveCommandView(dataView *dataview.DataView, spec models.Command) (*dataview.Definition, error)
ResolveCommandView returns the view definition of an extension API command. Columns take precedence over the view name. A view name is looked up in the command's extension first, and then in all views. nil is returned if the view name does not match any view
func StringArg ¶
func StringArg(cmd *CmdOptions, param *models.Parameter)
Types ¶
type BodyOptions ¶
type CmdOptions ¶
type CmdOptions struct {
Spec models.Command
Completion []completion.Option
Command *cobra.Command
Runtime []flags.Option
Header []flags.GetOption
QueryParameter []flags.GetOption
FormData []flags.GetOption
Body BodyOptions
Path PathOptions
RequiredFlags []string
}
func NewCommandWithOptions ¶
func NewCommandWithOptions(cmd *cobra.Command, endpoint models.Command) *CmdOptions
func (*CmdOptions) NewRuntimeCommand ¶
func (c *CmdOptions) NewRuntimeCommand(f *cmdutil.Factory) *RuntimeCmd
type PathOptions ¶
type RuntimeCmd ¶
type RuntimeCmd struct {
*subcommand.SubCommand
// contains filtered or unexported fields
}
func NewRuntimeCmd ¶
func NewRuntimeCmd(f *cmdutil.Factory, options *CmdOptions) *RuntimeCmd
NewRuntimeCmd creates a command which is created at runtime
func (*RuntimeCmd) Prepare ¶
func (n *RuntimeCmd) Prepare(args []string) error