get

package
v1.11.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdGet

func NewCmdGet(parent string, f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdGet creates a command object for the generic "get" action, which retrieves one or more resources from a server.

Types

type GetOptions

type GetOptions struct {
	PrintFlags           *PrintFlags
	ToPrinter            func(*meta.RESTMapping, bool) (printers.ResourcePrinterFunc, error)
	IsGeneric            bool
	PrintWithOpenAPICols bool

	CmdParent string

	resource.FilenameOptions

	Raw       string
	Watch     bool
	WatchOnly bool
	ChunkSize int64

	LabelSelector     string
	FieldSelector     string
	AllNamespaces     bool
	Namespace         string
	ExplicitNamespace bool

	ServerPrint bool

	NoHeaders      bool
	Sort           bool
	IgnoreNotFound bool
	Export         bool

	IncludeUninitialized bool

	genericclioptions.IOStreams
}

GetOptions contains the input to the get command.

func NewGetOptions

func NewGetOptions(parent string, streams genericclioptions.IOStreams) *GetOptions

NewGetOptions returns a GetOptions with default chunk size 500.

func (*GetOptions) Complete

func (o *GetOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Complete takes the command arguments and factory and infers any remaining options.

func (*GetOptions) Run

func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Run performs the get operation. TODO: remove the need to pass these arguments, like other commands.

func (*GetOptions) Validate

func (o *GetOptions) Validate(cmd *cobra.Command) error

Validate checks the set of flags provided by the user.

type HumanPrintFlags

type HumanPrintFlags struct {
	ShowKind     *bool
	ShowLabels   *bool
	SortBy       *string
	ColumnLabels *[]string

	// get.go-specific values
	NoHeaders bool

	Kind               schema.GroupKind
	AbsoluteTimestamps bool
	WithNamespace      bool
}

HumanPrintFlags provides default flags necessary for printing. Given the following flag values, a printer can be requested that knows how to handle printing based on these values.

func NewHumanPrintFlags

func NewHumanPrintFlags() *HumanPrintFlags

NewHumanPrintFlags returns flags associated with human-readable printing, with default values set.

func (*HumanPrintFlags) AddFlags

func (f *HumanPrintFlags) AddFlags(c *cobra.Command)

AddFlags receives a *cobra.Command reference and binds flags related to human-readable printing to it

func (*HumanPrintFlags) EnsureWithKind

func (f *HumanPrintFlags) EnsureWithKind(kind schema.GroupKind) error

EnsureWithKind sets the provided GroupKind humanreadable value. If the kind received is non-empty, the "showKind" humanreadable printer option is set to true.

func (*HumanPrintFlags) EnsureWithNamespace

func (f *HumanPrintFlags) EnsureWithNamespace() error

EnsureWithNamespace sets the "WithNamespace" humanreadable option to true.

func (*HumanPrintFlags) ToPrinter

func (f *HumanPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)

ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.

type PrintFlags

type PrintFlags struct {
	JSONYamlPrintFlags *printers.JSONYamlPrintFlags
	NamePrintFlags     *printers.NamePrintFlags
	TemplateFlags      *printers.KubeTemplatePrintFlags
	CustomColumnsFlags *printers.CustomColumnsPrintFlags
	HumanReadableFlags *HumanPrintFlags

	NoHeaders    *bool
	OutputFormat *string
}

PrintFlags composes common printer flag structs used in the Get command.

func NewGetPrintFlags

func NewGetPrintFlags() *PrintFlags

NewGetPrintFlags returns flags associated with humanreadable, template, and "name" printing, with default values set.

func (*PrintFlags) AddFlags

func (f *PrintFlags) AddFlags(cmd *cobra.Command)

AddFlags receives a *cobra.Command reference and binds flags related to humanreadable and template printing.

func (*PrintFlags) Copy

func (f *PrintFlags) Copy() PrintFlags

Copy returns a copy of PrintFlags for mutation

func (*PrintFlags) EnsureWithKind

func (f *PrintFlags) EnsureWithKind(kind schema.GroupKind) error

EnsureWithKind ensures that humanreadable flags return a printer capable of including resource kinds.

func (*PrintFlags) EnsureWithNamespace

func (f *PrintFlags) EnsureWithNamespace() error

EnsureWithNamespace ensures that humanreadable flags return a printer capable of printing with a "namespace" column.

func (*PrintFlags) ToPrinter

func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)

ToPrinter attempts to find a composed set of PrintFlags suitable for returning a printer based on current flag values.

func (*PrintFlags) UseOpenAPIColumns

func (f *PrintFlags) UseOpenAPIColumns(api openapi.Resources, mapping *meta.RESTMapping) error

UseOpenAPIColumns modifies the output format, as well as the "allowMissingKeys" option for template printers, to values defined in the OpenAPI schema of a resource.

Jump to

Keyboard shortcuts

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