Documentation
¶
Index ¶
- type Command
- func (c *Command) Argument(name string, args ...string) internal.ReflectManagedMethodExecuterSoapArgument
- func (c *Command) Method() string
- func (c *Command) Moid() string
- func (c *Command) Name() string
- func (c *Command) Namespace() string
- func (c *Command) Parse(params []CommandInfoParam) ([]internal.ReflectManagedMethodExecuterSoapArgument, error)
- type CommandInfo
- type CommandInfoHint
- type CommandInfoHints
- type CommandInfoItem
- type CommandInfoMethod
- type CommandInfoParam
- type Executor
- func (e *Executor) Client() *vim25.Client
- func (e *Executor) CommandInfo(ctx context.Context, ns string) (*CommandInfo, error)
- func (e *Executor) CommandInfoMethod(ctx context.Context, c *Command) (*CommandInfoMethod, error)
- func (e *Executor) DynamicTypeManager() types.ManagedObjectReference
- func (e *Executor) Execute(ctx context.Context, req *internal.ExecuteSoapRequest, res interface{}) error
- func (x *Executor) GetFirewallInfo(ctx context.Context) (*FirewallInfo, error)
- func (e *Executor) NewRequest(ctx context.Context, args []string) (*internal.ExecuteSoapRequest, *CommandInfoMethod, error)
- func (e *Executor) Run(ctx context.Context, args []string) (*Response, error)
- type Fault
- type FirewallInfo
- type GuestInfo
- type Response
- type Values
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func (*Command) Argument ¶
func (c *Command) Argument(name string, args ...string) internal.ReflectManagedMethodExecuterSoapArgument
func (*Command) Parse ¶
func (c *Command) Parse(params []CommandInfoParam) ([]internal.ReflectManagedMethodExecuterSoapArgument, error)
Parse generates a flag.FlagSet based on the given []CommandInfoParam and returns arguments for use with methods.ExecuteSoap
type CommandInfo ¶
type CommandInfo struct { CommandInfoItem Method []CommandInfoMethod `xml:"method" json:"method"` }
type CommandInfoHint ¶
type CommandInfoHints ¶
type CommandInfoHints []CommandInfoHint
func (CommandInfoHints) Fields ¶
func (h CommandInfoHints) Fields() []string
func (CommandInfoHints) Formatter ¶
func (h CommandInfoHints) Formatter() string
type CommandInfoItem ¶
type CommandInfoMethod ¶
type CommandInfoMethod struct { CommandInfoItem Param []CommandInfoParam `xml:"param" json:"param"` Hints CommandInfoHints `xml:"hints" json:"hints"` }
type CommandInfoParam ¶
type CommandInfoParam struct { CommandInfoItem Aliases []string `xml:"aliases" json:"aliases"` Flag bool `xml:"flag" json:"flag"` }
type Executor ¶
type Executor struct { Trace func(*internal.ExecuteSoapRequest, *internal.ExecuteSoapResponse) // contains filtered or unexported fields }
func NewExecutor ¶
func (*Executor) CommandInfo ¶
func (*Executor) CommandInfoMethod ¶
func (*Executor) DynamicTypeManager ¶
func (e *Executor) DynamicTypeManager() types.ManagedObjectReference
func (*Executor) GetFirewallInfo ¶
func (x *Executor) GetFirewallInfo(ctx context.Context) (*FirewallInfo, error)
GetFirewallInfo via 'esxcli network firewall get' The HostFirewallSystem type does not expose this data. This helper can be useful in particular to determine if the firewall is enabled or disabled.
func (*Executor) NewRequest ¶
func (e *Executor) NewRequest(ctx context.Context, args []string) (*internal.ExecuteSoapRequest, *CommandInfoMethod, error)
func (*Executor) Run ¶
Example ¶
package main import ( "context" "fmt" "github.com/vmware/govmomi/cli/esx" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" ) func main() { simulator.Run(func(ctx context.Context, c *vim25.Client) error { host, err := find.NewFinder(c).HostSystem(ctx, "DC0_H0") if err != nil { return err } x, err := esx.NewExecutor(ctx, c, host) if err != nil { return err } res, err := x.Run(ctx, []string{"software", "vib", "list"}) if err != nil { return err } for _, vib := range res.Values { fmt.Println(vib.Value("Name")) } return nil }) }
Output: esx-ui intelgpio
type Fault ¶
func (Fault) MessageDetail ¶
type FirewallInfo ¶
type GuestInfo ¶
type GuestInfo struct {
// contains filtered or unexported fields
}
func NewGuestInfo ¶
type Response ¶
type Response struct { Info *CommandInfoMethod `json:"info"` Values []Values `json:"values"` String string `json:"string"` Kind string `json:"-"` }
func (*Response) MarshalXML ¶
func (*Response) UnmarshalXML ¶
Click to show internal directories.
Click to hide internal directories.