cmd

package
v0.0.0-...-d37b43c Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Query array resources",
	Long:  `Get information about specific array resources`,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("get called")
	},
}

GetCmd represents the get command

Functions

func Contains

func Contains(a []string, x string) bool

Contains tells whether a contains x.

func PrettyPrint

func PrettyPrint(v interface{}) (err error)

PrettyPrint print pretty output

func ValidateResponseStatus

func ValidateResponseStatus(r io.Reader) (err error)

ValidateResponseStatus checks for errors in Array response XML

Types

type HpArray

type HpArray struct {
	URL string

	Client *http.Client
	// contains filtered or unexported fields
}

HpArray holds array credentials and URL

func (*HpArray) ShowHosts

func (a *HpArray) ShowHosts() ([]string, error)

ShowHosts prints out list of hosts

func (*HpArray) ShowVolumes

func (a *HpArray) ShowVolumes(volumeType string) ([]string, error)

ShowVolumes prints list of volumes to stdout

type OBJECT

type OBJECT struct {
	XMLName  xml.Name   `xml:"OBJECT"`
	Basetype string     `xml:"basetype,attr"`
	Name     string     `xml:"name,attr"`
	Oid      string     `xml:"oid,attr"`
	Format   string     `xml:"format,attr"`
	PROPERTY []PROPERTY `xml:"PROPERTY"`
}

OBJECT struct holds all returned objects (hosts/volumes etc.)

type PROPERTY

type PROPERTY struct {
	XMLName     xml.Name `xml:"PROPERTY"`
	Text        string   `xml:",chardata"`
	Name        string   `xml:"name,attr"`
	Type        string   `xml:"type,attr"`
	Size        string   `xml:"size,attr"`
	Draw        string   `xml:"draw,attr"`
	Sort        string   `xml:"sort,attr"`
	DisplayName string   `xml:"display-name,attr"`
	Units       string   `xml:"units,attr"`
	Key         string   `xml:"key,attr"`
	Blocksize   string   `xml:"blocksize,attr"`
}

PROPERTY holds attributes for a given object (volume size/ host name etc.)

type Response

type Response struct {
	XMLName xml.Name `xml:"RESPONSE"`
	Text    string   `xml:",chardata"`
	Link    struct {
		Text string `xml:",chardata"`
		Type string `xml:"type,attr"`
		ID   string `xml:"id,attr"`
		Rel  string `xml:"rel,attr"`
		Href string `xml:"href,attr"`
	} `xml:"link"`
	Style struct {
		Text string `xml:",chardata"`
		Type string `xml:"type,attr"`
		ID   string `xml:"id,attr"`
	} `xml:"style"`
	OBJECT []OBJECT `xml:"OBJECT"`
}

Response is returned by the array after every request.

Jump to

Keyboard shortcuts

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