govmomi: github.com/vmware/govmomi/govc/flags Index | Files

package flags

import "github.com/vmware/govmomi/govc/flags"

Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Package Files

client.go cluster.go common.go datacenter.go datastore.go debug.go empty.go folder.go host_connect.go host_system.go int32.go int64.go network.go optional_bool.go output.go resource_allocation_info.go resource_pool.go search.go storage_pod.go version.go virtual_app.go virtual_machine.go

Constants

const (
    SearchVirtualMachines = iota + 1
    SearchHosts
    SearchVirtualApps
)
const Version = "0.20.0"

Variables

var GitVersion string

func NewInt32 Uses

func NewInt32(v *int32) flag.Value

NewInt32 behaves as flag.IntVar, but using an int32 type.

func NewInt64 Uses

func NewInt64(v *int64) flag.Value

NewInt64 behaves as flag.IntVar, but using an int64 type.

func NewOptionalBool Uses

func NewOptionalBool(v **bool) flag.Value

NewOptionalBool returns a flag.Value implementation where there is no default value. This avoids sending a default value over the wire as using flag.BoolVar() would.

func NewOptionalInt32 Uses

func NewOptionalInt32(v **int32) flag.Value

func NewOptionalInt64 Uses

func NewOptionalInt64(v **int64) flag.Value

func ParseVersion Uses

func ParseVersion(s string) (version, error)

type ClientFlag Uses

type ClientFlag struct {
    *DebugFlag

    Login func(context.Context, *vim25.Client) error
    // contains filtered or unexported fields
}

func NewClientFlag Uses

func NewClientFlag(ctx context.Context) (*ClientFlag, context.Context)

func (*ClientFlag) Client Uses

func (flag *ClientFlag) Client() (*vim25.Client, error)

func (*ClientFlag) Environ Uses

func (flag *ClientFlag) Environ(extra bool) []string

Environ returns the govc environment variables for this connection

func (*ClientFlag) IsSecure Uses

func (flag *ClientFlag) IsSecure() bool

func (*ClientFlag) Logout Uses

func (flag *ClientFlag) Logout(ctx context.Context) error

func (*ClientFlag) Process Uses

func (flag *ClientFlag) Process(ctx context.Context) error

func (*ClientFlag) ProcessOnce Uses

func (c *ClientFlag) ProcessOnce(fn func() error) (err error)

func (*ClientFlag) Register Uses

func (flag *ClientFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*ClientFlag) RegisterOnce Uses

func (c *ClientFlag) RegisterOnce(fn func())

func (*ClientFlag) Set Uses

func (flag *ClientFlag) Set(s string) error

func (*ClientFlag) SetRootCAs Uses

func (flag *ClientFlag) SetRootCAs(c *soap.Client) error

func (*ClientFlag) String Uses

func (flag *ClientFlag) String() string

func (*ClientFlag) URLWithoutPassword Uses

func (flag *ClientFlag) URLWithoutPassword() *url.URL

func (*ClientFlag) Userinfo Uses

func (flag *ClientFlag) Userinfo() *url.Userinfo

func (*ClientFlag) WithCancel Uses

func (flag *ClientFlag) WithCancel(ctx context.Context, f func(context.Context) error) error

WithCancel calls the given function, returning when complete or canceled via SIGINT.

func (*ClientFlag) WithRestClient Uses

func (flag *ClientFlag) WithRestClient(ctx context.Context, f func(*rest.Client) error) error

type ClusterFlag Uses

type ClusterFlag struct {
    *DatacenterFlag

    Name string
    // contains filtered or unexported fields
}

func NewClusterFlag Uses

func NewClusterFlag(ctx context.Context) (*ClusterFlag, context.Context)

func (*ClusterFlag) Cluster Uses

func (f *ClusterFlag) Cluster() (*object.ClusterComputeResource, error)

func (*ClusterFlag) ClusterIfSpecified Uses

func (f *ClusterFlag) ClusterIfSpecified() (*object.ClusterComputeResource, error)

func (*ClusterFlag) Names Uses

func (f *ClusterFlag) Names(ctx context.Context, refs []types.ManagedObjectReference) (map[types.ManagedObjectReference]string, error)

func (*ClusterFlag) ObjectList Uses

func (f *ClusterFlag) ObjectList(ctx context.Context, kind string, names []string) ([]types.ManagedObjectReference, error)

func (*ClusterFlag) Process Uses

func (f *ClusterFlag) Process(ctx context.Context) error

func (*ClusterFlag) ProcessOnce Uses

func (c *ClusterFlag) ProcessOnce(fn func() error) (err error)

func (*ClusterFlag) Reconfigure Uses

func (f *ClusterFlag) Reconfigure(ctx context.Context, spec types.BaseComputeResourceConfigSpec) error

func (*ClusterFlag) Register Uses

func (f *ClusterFlag) Register(ctx context.Context, fs *flag.FlagSet)

func (*ClusterFlag) RegisterOnce Uses

func (c *ClusterFlag) RegisterOnce(fn func())

type DatacenterFlag Uses

type DatacenterFlag struct {
    *ClientFlag
    *OutputFlag

    Name string
    // contains filtered or unexported fields
}

func NewDatacenterFlag Uses

func NewDatacenterFlag(ctx context.Context) (*DatacenterFlag, context.Context)

func (*DatacenterFlag) Datacenter Uses

func (flag *DatacenterFlag) Datacenter() (*object.Datacenter, error)

func (*DatacenterFlag) DatacenterIfSpecified Uses

func (flag *DatacenterFlag) DatacenterIfSpecified() (*object.Datacenter, error)

func (*DatacenterFlag) Finder Uses

func (flag *DatacenterFlag) Finder(all ...bool) (*find.Finder, error)

func (*DatacenterFlag) ManagedObject Uses

func (flag *DatacenterFlag) ManagedObject(ctx context.Context, arg string) (types.ManagedObjectReference, error)

func (*DatacenterFlag) ManagedObjects Uses

func (flag *DatacenterFlag) ManagedObjects(ctx context.Context, args []string) ([]types.ManagedObjectReference, error)

func (*DatacenterFlag) Process Uses

func (flag *DatacenterFlag) Process(ctx context.Context) error

func (*DatacenterFlag) ProcessOnce Uses

func (c *DatacenterFlag) ProcessOnce(fn func() error) (err error)

func (*DatacenterFlag) Register Uses

func (flag *DatacenterFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*DatacenterFlag) RegisterOnce Uses

func (c *DatacenterFlag) RegisterOnce(fn func())

type DatastoreFlag Uses

type DatastoreFlag struct {
    *DatacenterFlag

    Name string
    // contains filtered or unexported fields
}

func NewCustomDatastoreFlag Uses

func NewCustomDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context)

NewCustomDatastoreFlag creates and returns a new DatastoreFlag without trying to retrieve an existing one from the specified context.

func NewDatastoreFlag Uses

func NewDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context)

func (*DatastoreFlag) Args Uses

func (f *DatastoreFlag) Args(args []string) []object.DatastorePath

func (*DatastoreFlag) Datastore Uses

func (f *DatastoreFlag) Datastore() (*object.Datastore, error)

func (*DatastoreFlag) DatastoreIfSpecified Uses

func (flag *DatastoreFlag) DatastoreIfSpecified() (*object.Datastore, error)

func (*DatastoreFlag) DatastorePath Uses

func (f *DatastoreFlag) DatastorePath(name string) (string, error)

func (*DatastoreFlag) Process Uses

func (f *DatastoreFlag) Process(ctx context.Context) error

func (*DatastoreFlag) ProcessOnce Uses

func (c *DatastoreFlag) ProcessOnce(fn func() error) (err error)

func (*DatastoreFlag) Register Uses

func (f *DatastoreFlag) Register(ctx context.Context, fs *flag.FlagSet)

func (*DatastoreFlag) RegisterOnce Uses

func (c *DatastoreFlag) RegisterOnce(fn func())

func (*DatastoreFlag) Stat Uses

func (f *DatastoreFlag) Stat(ctx context.Context, file string) (types.BaseFileInfo, error)

type DebugFlag Uses

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

func NewDebugFlag Uses

func NewDebugFlag(ctx context.Context) (*DebugFlag, context.Context)

func (*DebugFlag) Process Uses

func (flag *DebugFlag) Process(ctx context.Context) error

func (*DebugFlag) ProcessOnce Uses

func (c *DebugFlag) ProcessOnce(fn func() error) (err error)

func (*DebugFlag) Register Uses

func (flag *DebugFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*DebugFlag) RegisterOnce Uses

func (c *DebugFlag) RegisterOnce(fn func())

type EmptyFlag Uses

type EmptyFlag struct{}

func (*EmptyFlag) Process Uses

func (flag *EmptyFlag) Process(ctx context.Context) error

func (*EmptyFlag) Register Uses

func (flag *EmptyFlag) Register(ctx context.Context, f *flag.FlagSet)

type FolderFlag Uses

type FolderFlag struct {
    *DatacenterFlag
    // contains filtered or unexported fields
}

func NewFolderFlag Uses

func NewFolderFlag(ctx context.Context) (*FolderFlag, context.Context)

func (*FolderFlag) Folder Uses

func (flag *FolderFlag) Folder() (*object.Folder, error)

func (*FolderFlag) FolderOrDefault Uses

func (flag *FolderFlag) FolderOrDefault(kind string) (*object.Folder, error)

func (*FolderFlag) Process Uses

func (flag *FolderFlag) Process(ctx context.Context) error

func (*FolderFlag) ProcessOnce Uses

func (c *FolderFlag) ProcessOnce(fn func() error) (err error)

func (*FolderFlag) Register Uses

func (flag *FolderFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*FolderFlag) RegisterOnce Uses

func (c *FolderFlag) RegisterOnce(fn func())

type HostConnectFlag Uses

type HostConnectFlag struct {
    types.HostConnectSpec
    // contains filtered or unexported fields
}

func NewHostConnectFlag Uses

func NewHostConnectFlag(ctx context.Context) (*HostConnectFlag, context.Context)

func (*HostConnectFlag) Fault Uses

func (flag *HostConnectFlag) Fault(err error) error

Fault checks if error is SSLVerifyFault, including the thumbprint if so

func (*HostConnectFlag) Process Uses

func (flag *HostConnectFlag) Process(ctx context.Context) error

func (*HostConnectFlag) ProcessOnce Uses

func (c *HostConnectFlag) ProcessOnce(fn func() error) (err error)

func (*HostConnectFlag) Register Uses

func (flag *HostConnectFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*HostConnectFlag) RegisterOnce Uses

func (c *HostConnectFlag) RegisterOnce(fn func())

func (*HostConnectFlag) Spec Uses

func (flag *HostConnectFlag) Spec(c *vim25.Client) types.HostConnectSpec

Spec attempts to fill in SslThumbprint if empty. First checks GOVC_TLS_KNOWN_HOSTS, if not found and noverify=true then use object.HostCertificateInfo to get the thumbprint.

type HostSystemFlag Uses

type HostSystemFlag struct {
    *ClientFlag
    *DatacenterFlag
    *SearchFlag
    // contains filtered or unexported fields
}

func NewHostSystemFlag Uses

func NewHostSystemFlag(ctx context.Context) (*HostSystemFlag, context.Context)

func (*HostSystemFlag) HostNetworkSystem Uses

func (flag *HostSystemFlag) HostNetworkSystem() (*object.HostNetworkSystem, error)

func (*HostSystemFlag) HostSystem Uses

func (flag *HostSystemFlag) HostSystem() (*object.HostSystem, error)

func (*HostSystemFlag) HostSystemIfSpecified Uses

func (flag *HostSystemFlag) HostSystemIfSpecified() (*object.HostSystem, error)

func (*HostSystemFlag) Process Uses

func (flag *HostSystemFlag) Process(ctx context.Context) error

func (*HostSystemFlag) ProcessOnce Uses

func (c *HostSystemFlag) ProcessOnce(fn func() error) (err error)

func (*HostSystemFlag) Register Uses

func (flag *HostSystemFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*HostSystemFlag) RegisterOnce Uses

func (c *HostSystemFlag) RegisterOnce(fn func())

type NetworkFlag Uses

type NetworkFlag struct {
    *DatacenterFlag
    // contains filtered or unexported fields
}

func NewNetworkFlag Uses

func NewNetworkFlag(ctx context.Context) (*NetworkFlag, context.Context)

func (*NetworkFlag) Change Uses

func (flag *NetworkFlag) Change(device types.BaseVirtualDevice, update types.BaseVirtualDevice)

Change applies update backing and hardware address changes to the given network device.

func (*NetworkFlag) Device Uses

func (flag *NetworkFlag) Device() (types.BaseVirtualDevice, error)

func (*NetworkFlag) IsSet Uses

func (flag *NetworkFlag) IsSet() bool

func (*NetworkFlag) Network Uses

func (flag *NetworkFlag) Network() (object.NetworkReference, error)

func (*NetworkFlag) Process Uses

func (flag *NetworkFlag) Process(ctx context.Context) error

func (*NetworkFlag) ProcessOnce Uses

func (c *NetworkFlag) ProcessOnce(fn func() error) (err error)

func (*NetworkFlag) Register Uses

func (flag *NetworkFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*NetworkFlag) RegisterOnce Uses

func (c *NetworkFlag) RegisterOnce(fn func())

func (*NetworkFlag) Set Uses

func (flag *NetworkFlag) Set(name string) error

func (*NetworkFlag) String Uses

func (flag *NetworkFlag) String() string

type OutputFlag Uses

type OutputFlag struct {
    JSON bool
    TTY  bool
    Dump bool
    Out  io.Writer
    // contains filtered or unexported fields
}

func NewOutputFlag Uses

func NewOutputFlag(ctx context.Context) (*OutputFlag, context.Context)

func (*OutputFlag) All Uses

func (flag *OutputFlag) All() bool

func (*OutputFlag) Log Uses

func (flag *OutputFlag) Log(s string) (int, error)

Log outputs the specified string, prefixed with the current time. A newline is not automatically added. If the specified string starts with a '\r', the current line is cleared first.

func (*OutputFlag) Process Uses

func (flag *OutputFlag) Process(ctx context.Context) error

func (*OutputFlag) ProcessOnce Uses

func (c *OutputFlag) ProcessOnce(fn func() error) (err error)

func (*OutputFlag) ProgressLogger Uses

func (flag *OutputFlag) ProgressLogger(prefix string) *progressLogger

func (*OutputFlag) Register Uses

func (flag *OutputFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*OutputFlag) RegisterOnce Uses

func (c *OutputFlag) RegisterOnce(fn func())

func (*OutputFlag) Write Uses

func (flag *OutputFlag) Write(b []byte) (int, error)

func (*OutputFlag) WriteResult Uses

func (flag *OutputFlag) WriteResult(result OutputWriter) error

func (*OutputFlag) WriteString Uses

func (flag *OutputFlag) WriteString(s string) (int, error)

type OutputWriter Uses

type OutputWriter interface {
    Write(io.Writer) error
}

type ResourceAllocationFlag Uses

type ResourceAllocationFlag struct {
    ExpandableReservation bool
    // contains filtered or unexported fields
}

func NewResourceAllocationFlag Uses

func NewResourceAllocationFlag(cpu, mem *types.ResourceAllocationInfo) *ResourceAllocationFlag

func (*ResourceAllocationFlag) Process Uses

func (s *ResourceAllocationFlag) Process(ctx context.Context) error

func (*ResourceAllocationFlag) Register Uses

func (r *ResourceAllocationFlag) Register(ctx context.Context, f *flag.FlagSet)

type ResourcePoolFlag Uses

type ResourcePoolFlag struct {
    *DatacenterFlag
    // contains filtered or unexported fields
}

func NewResourcePoolFlag Uses

func NewResourcePoolFlag(ctx context.Context) (*ResourcePoolFlag, context.Context)

func (*ResourcePoolFlag) Process Uses

func (flag *ResourcePoolFlag) Process(ctx context.Context) error

func (*ResourcePoolFlag) ProcessOnce Uses

func (c *ResourcePoolFlag) ProcessOnce(fn func() error) (err error)

func (*ResourcePoolFlag) Register Uses

func (flag *ResourcePoolFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*ResourcePoolFlag) RegisterOnce Uses

func (c *ResourcePoolFlag) RegisterOnce(fn func())

func (*ResourcePoolFlag) ResourcePool Uses

func (flag *ResourcePoolFlag) ResourcePool() (*object.ResourcePool, error)

func (*ResourcePoolFlag) ResourcePoolIfSpecified Uses

func (flag *ResourcePoolFlag) ResourcePoolIfSpecified() (*object.ResourcePool, error)

type SearchFlag Uses

type SearchFlag struct {
    *ClientFlag
    *DatacenterFlag
    // contains filtered or unexported fields
}

func NewSearchFlag Uses

func NewSearchFlag(ctx context.Context, t int) (*SearchFlag, context.Context)

func (*SearchFlag) HostSystem Uses

func (flag *SearchFlag) HostSystem() (*object.HostSystem, error)

func (*SearchFlag) HostSystems Uses

func (flag *SearchFlag) HostSystems(args []string) ([]*object.HostSystem, error)

func (*SearchFlag) IsSet Uses

func (flag *SearchFlag) IsSet() bool

func (*SearchFlag) Process Uses

func (flag *SearchFlag) Process(ctx context.Context) error

func (*SearchFlag) ProcessOnce Uses

func (c *SearchFlag) ProcessOnce(fn func() error) (err error)

func (*SearchFlag) Register Uses

func (flag *SearchFlag) Register(ctx context.Context, fs *flag.FlagSet)

func (*SearchFlag) RegisterOnce Uses

func (c *SearchFlag) RegisterOnce(fn func())

func (*SearchFlag) VirtualApp Uses

func (flag *SearchFlag) VirtualApp() (*object.VirtualApp, error)

func (*SearchFlag) VirtualApps Uses

func (flag *SearchFlag) VirtualApps(args []string) ([]*object.VirtualApp, error)

func (*SearchFlag) VirtualMachine Uses

func (flag *SearchFlag) VirtualMachine() (*object.VirtualMachine, error)

func (*SearchFlag) VirtualMachines Uses

func (flag *SearchFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error)

type StoragePodFlag Uses

type StoragePodFlag struct {
    *DatacenterFlag

    Name string
    // contains filtered or unexported fields
}

func NewStoragePodFlag Uses

func NewStoragePodFlag(ctx context.Context) (*StoragePodFlag, context.Context)

func (*StoragePodFlag) Isset Uses

func (f *StoragePodFlag) Isset() bool

func (*StoragePodFlag) Process Uses

func (f *StoragePodFlag) Process(ctx context.Context) error

func (*StoragePodFlag) ProcessOnce Uses

func (c *StoragePodFlag) ProcessOnce(fn func() error) (err error)

func (*StoragePodFlag) Register Uses

func (f *StoragePodFlag) Register(ctx context.Context, fs *flag.FlagSet)

func (*StoragePodFlag) RegisterOnce Uses

func (c *StoragePodFlag) RegisterOnce(fn func())

func (*StoragePodFlag) StoragePod Uses

func (f *StoragePodFlag) StoragePod() (*object.StoragePod, error)

type VirtualAppFlag Uses

type VirtualAppFlag struct {
    *DatacenterFlag
    *SearchFlag
    // contains filtered or unexported fields
}

func NewVirtualAppFlag Uses

func NewVirtualAppFlag(ctx context.Context) (*VirtualAppFlag, context.Context)

func (*VirtualAppFlag) Process Uses

func (flag *VirtualAppFlag) Process(ctx context.Context) error

func (*VirtualAppFlag) ProcessOnce Uses

func (c *VirtualAppFlag) ProcessOnce(fn func() error) (err error)

func (*VirtualAppFlag) Register Uses

func (flag *VirtualAppFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*VirtualAppFlag) RegisterOnce Uses

func (c *VirtualAppFlag) RegisterOnce(fn func())

func (*VirtualAppFlag) VirtualApp Uses

func (flag *VirtualAppFlag) VirtualApp() (*object.VirtualApp, error)

type VirtualMachineFlag Uses

type VirtualMachineFlag struct {
    *ClientFlag
    *DatacenterFlag
    *SearchFlag
    // contains filtered or unexported fields
}

func NewVirtualMachineFlag Uses

func NewVirtualMachineFlag(ctx context.Context) (*VirtualMachineFlag, context.Context)

func (*VirtualMachineFlag) Process Uses

func (flag *VirtualMachineFlag) Process(ctx context.Context) error

func (*VirtualMachineFlag) ProcessOnce Uses

func (c *VirtualMachineFlag) ProcessOnce(fn func() error) (err error)

func (*VirtualMachineFlag) Register Uses

func (flag *VirtualMachineFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*VirtualMachineFlag) RegisterOnce Uses

func (c *VirtualMachineFlag) RegisterOnce(fn func())

func (*VirtualMachineFlag) VirtualMachine Uses

func (flag *VirtualMachineFlag) VirtualMachine() (*object.VirtualMachine, error)

Package flags imports 35 packages (graph) and is imported by 814 packages. Updated 2019-06-19. Refresh now. Tools for package owners.