cmd

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute is the entrypoint of the metal-go application

func Prompt added in v0.10.5

func Prompt(msg, compare string) error

Prompt the user to given compare text

func SSHClient

func SSHClient(user, keyfile, host string, port int) error

SSHClient opens a interactive ssh session to the host on port with user, authenticated by the key.

Types

type Context

type Context struct {
	ApiURL       string  `yaml:"url"`
	IssuerURL    string  `yaml:"issuer_url"`
	IssuerType   string  `yaml:"issuer_type"`
	CustomScopes string  `yaml:"custom_scopes"`
	ClientID     string  `yaml:"client_id"`
	ClientSecret string  `yaml:"client_secret"`
	HMAC         *string `yaml:"hmac"`
}

Context configure metalctl behaviour

type ContextPrinter

type ContextPrinter struct {
	TablePrinter
}

ContextPrinter is a table printer with context

func (ContextPrinter) Print

func (m ContextPrinter) Print(data *Contexts) error

Print a model in yaml format

type Contexts

type Contexts struct {
	CurrentContext  string `yaml:"current"`
	PreviousContext string `yaml:"previous"`
	Contexts        map[string]Context
}

Contexts contains all configuration contexts of metalctl

type Detailer

type Detailer interface {
	Detail(data interface{}) error
}

Detailer prints more details than a Printer

func NewDetailer

func NewDetailer(format string) (Detailer, error)

NewDetailer create a new Detailer which will print more details about metal objects.

type FilesystemLayoutPrinter added in v0.9.6

type FilesystemLayoutPrinter struct {
	TablePrinter
}

FilesystemLayoutPrinter is a table printer for Filesystemlayouts

func (FilesystemLayoutPrinter) Print added in v0.9.6

type FilterOpts

type FilterOpts struct {
	ID        string
	Partition string
	Size      string
	Name      string
	Project   string
	Image     string
	Hostname  string
	Mac       string
	Tags      []string
}

type JSONPrinter

type JSONPrinter struct{}

JSONPrinter returns the model in json format

func (JSONPrinter) Detail

func (j JSONPrinter) Detail(data interface{}) error

Detail is identical to Print for json

func (JSONPrinter) Print

func (j JSONPrinter) Print(data interface{}) error

Print a model in json format

type MachineAndIssues added in v0.8.5

type MachineAndIssues struct {
	Machine models.V1MachineResponse
	Issues  []string
}

MachineAndIssues summarizes a machine with issues

type MachineIssues added in v0.8.5

type MachineIssues map[string]MachineAndIssues

MachineIssues is map of a machine response to a list of machine issues

type MachineWithIPMIPrinter

type MachineWithIPMIPrinter struct {
	TablePrinter
}

MachineWithIPMIPrinter is a table printer with Machine IPMI data

func (MachineWithIPMIPrinter) Order

Order ipmi data from machines

func (MachineWithIPMIPrinter) Print

Print ipmi data from machines

type MetalAnyTableDetailer

type MetalAnyTableDetailer struct {
	TableDetailer
}

MetalAnyTableDetailer is a Detailer for a any payload

func (MetalAnyTableDetailer) Detail

func (m MetalAnyTableDetailer) Detail(data interface{})

Detail MetalIP

type MetalFirewallTablePrinter

type MetalFirewallTablePrinter struct {
	TablePrinter
}

MetalFirewallTablePrinter is a table printer for a MetalFirewall

func (MetalFirewallTablePrinter) Print

Print a MetalFirewall in a table

type MetalFirmwaresPrinter added in v0.10.1

type MetalFirmwaresPrinter struct {
	TablePrinter
}

MetalFirmwaresPrinter prints firmwares

func (MetalFirmwaresPrinter) Print added in v0.10.1

Print ipmi data from machines

type MetalIPTablePrinter

type MetalIPTablePrinter struct {
	TablePrinter
}

MetalIPTablePrinter is a table printer for a MetalIP

func (MetalIPTablePrinter) Print

func (m MetalIPTablePrinter) Print(data []*models.V1IPResponse)

Print all MetalIPs in a table

type MetalImageTablePrinter

type MetalImageTablePrinter struct {
	TablePrinter
}

MetalImageTablePrinter is a table printer for a MetalImage

func (MetalImageTablePrinter) Print

Print a MetalImage in a table

type MetalMachineAllocationTablePrinter

type MetalMachineAllocationTablePrinter struct {
	TablePrinter
}

MetalMachineAllocationTablePrinter is a table printer for a MetalMachine

type MetalMachineIssuesTablePrinter added in v0.8.5

type MetalMachineIssuesTablePrinter struct {
	TablePrinter
}

MetalMachineIssuesTablePrinter is a table printer for a MetalMachine issues

func (MetalMachineIssuesTablePrinter) Print added in v0.8.5

Print a MetalSize in a table

type MetalMachineLogsPrinter

type MetalMachineLogsPrinter struct {
	TablePrinter
}

MetalMachineLogsPrinter prints machine logs

func (MetalMachineLogsPrinter) Print

Print machine logs

type MetalMachineTablePrinter

type MetalMachineTablePrinter struct {
	TablePrinter
}

MetalMachineTablePrinter is a table printer for a MetalMachine

func (MetalMachineTablePrinter) Order

Order machines

func (MetalMachineTablePrinter) Print

Print a list of Machines in a table

type MetalNetworkTablePrinter

type MetalNetworkTablePrinter struct {
	TablePrinter
}

MetalNetworkTablePrinter is a table printer for a MetalNetwork

func (MetalNetworkTablePrinter) Print

Print all MetalNetworks in a table

type MetalPartitionCapacityTablePrinter

type MetalPartitionCapacityTablePrinter struct {
	TablePrinter
}

MetalPartitionCapacityTablePrinter is a table printer for a MetalPartition

func (MetalPartitionCapacityTablePrinter) Print

Print a PartitionCapacity in a table

type MetalPartitionTablePrinter

type MetalPartitionTablePrinter struct {
	TablePrinter
}

MetalPartitionTablePrinter is a table printer for a MetalPartition

func (MetalPartitionTablePrinter) Print

Print a MetalPartition in a table

type MetalProjectTablePrinter

type MetalProjectTablePrinter struct {
	TablePrinter
}

MetalProjectTablePrinter is a table printer for a MetalProject

func (MetalProjectTablePrinter) Order added in v0.8.3

Order Project

func (MetalProjectTablePrinter) Print

Print all MetalIPs in a table

type MetalSizeMatchingLogTablePrinter

type MetalSizeMatchingLogTablePrinter struct {
	TablePrinter
}

MetalSizeMatchingLogTablePrinter is a table printer for a MetalSizeMatchingLog

func (MetalSizeMatchingLogTablePrinter) Print

Print a MetalSize in a table

type MetalSizeTablePrinter

type MetalSizeTablePrinter struct {
	TablePrinter
}

MetalSizeTablePrinter is a table printer for a MetalSize

func (MetalSizeTablePrinter) Print

func (m MetalSizeTablePrinter) Print(data []*models.V1SizeResponse)

Print a MetalSize in a table

type MetalSwitchTableDetailer

type MetalSwitchTableDetailer struct {
	TableDetailer
}

MetalSwitchTableDetailer is a table printer for a MetalSwitch

func (MetalSwitchTableDetailer) Detail

Detail MetalSwitch

type MetalSwitchTablePrinter

type MetalSwitchTablePrinter struct {
	TablePrinter
}

MetalSwitchTablePrinter is a table printer for a MetalSwitch

func (MetalSwitchTablePrinter) Print

Print all MetalSwitch(es) in a table

type Printer

type Printer interface {
	Print(data interface{}) error
}

Printer main Interface for implementations which spits out to stdout

func NewPrinter

func NewPrinter(format, order, tpl string, noHeaders bool) (Printer, error)

NewPrinter returns a suitable stdout printer for the given format

type TableDetailer

type TableDetailer struct {
	// contains filtered or unexported fields
}

TableDetailer produces a human readable model representation

func (TableDetailer) Detail

func (t TableDetailer) Detail(data interface{}) error

Detail a model in a human readable table

type TablePrinter

type TablePrinter struct {
	// contains filtered or unexported fields
}

TablePrinter produces a human readable model representation

func (TablePrinter) Print

func (t TablePrinter) Print(data interface{}) error

Print a model in a human readable table

type Version added in v0.10.1

type Version struct {
	Client string                   `yaml:"client"`
	Server *metalmodels.RestVersion `yaml:"server,omitempty"`
}

type YAMLPrinter

type YAMLPrinter struct{}

YAMLPrinter returns the model in yaml format

func (YAMLPrinter) Detail

func (y YAMLPrinter) Detail(data interface{}) error

Detail is identical to Print for json

func (YAMLPrinter) Print

func (y YAMLPrinter) Print(data interface{}) error

Print a model in yaml format

Jump to

Keyboard shortcuts

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